עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

בעיה בpygame

Featured Replies

פורסם

התחלתי לא מזמן ללמוד פייתון (זה אני מהדיון הקודם) והתקדמתי לא רע.. ואחרי שצברתי קצת ידע אני צריך גם תרגול מעשי, הרצתי חיפוש בגוגל ומצאתי את 'pygame' התקנתי את התוכנה, הכל טוב ויפה, אבל אני לא מצליח להשתמש בתוסף. כשאני רושם את הקוד הזה:

import pygame, sys


pygame.init()
screen = pygame.display.set_mode([200,200])
image = pygame.image.load('C:\Python27\sim.png').convert_alpha()
screen.fill([255,255,255])
screen.blit(image,[0,0])
pygame.display.update()

מופיע לי חלון לבן קטן (כמצופה) רק שהוא תקוע, ואז אני חייב לצאת מהתוכנית.

פורסם

מה זאת אומרת "תקוע"? בעקרון זה הגיוני, כי לא כתבת שום קוד שמטפל באירועים שמגיעים מהחלון שיצרת.

מאיפה הקוד הזה שכתבת? מאיזה מקור אתה לומד?

אם אתה רוצה ללמוד תוך פיתוח משחקים עם pygame, אני מציע לך ללמוד מ-Invent With Python, זה מדריך מאוד חביב:

http://inventwithpython.com/chapters/

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.