נבנה על ידיBuilt by Ariel Yohimovich

PythonPython
48
חלקPart 7: משחקים עם PygameGames with Pygame כ-3 שעות (כולל הפסקה)About 3 hours (with a break)

Crystal Quest, חלק 2 ופרסוםCrystal Quest, part 2 & publishing

חפצים, אויבים עם AI, קרבות, בוס, שמירה ב-JSON ופרסום לדפדפן עם pygbag.

Items, enemies with AI, combat, a boss, saving to JSON and publishing to the browser with pygbag.

איך מריצים את הקוד של המפגשRunning this session's code

כל דוגמה בהרצאה וכל תרגיל אפשר להריץ ישירות בדפדפן עם הכפתור הרצה. כדי לעבוד במחשב: יוצרים קובץ ‎.py בתיקיית הקורס ב-VS Code, מדביקים, שומרים ומריצים.

Every lecture example and exercise runs right in the browser with the Run button. To work on your computer: create a .py file in the course folder in VS Code, paste, save and run.

פעולהActionMacMacWindowsWindows
הרצת קובץRun a filepython3 file.pypython file.py

התקנת חבילות למפגשPackages for this session

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

This session uses external packages. Install them once, ideally inside a virtual environment (session 13):

Mac
python3 -m pip install pygame-ce
Windows
python -m pip install pygame-ce

פתרון בעיותTroubleshooting

בעיהProblemסיבהCauseפתרוןFix
ModuleNotFoundErrorModuleNotFoundErrorהחבילה לא מותקנת בסביבה שמריצה את הקודThe package isn't installed where the code runsמתקינים עם pip, ובודקים ב-VS Code שנבחר המפרש הנכוןInstall with pip and check VS Code uses the right interpreter
הכפתור הרצה בדפדפן לא עובדThe browser Run button does nothingPython בדפדפן נטען מהאינטרנט בלחיצה הראשונהPython in the browser loads from the internet on first clickבודקים חיבור לאינטרנט ומחכים כמה שניות. אפשר תמיד להריץ ב-VS CodeCheck the connection and wait a few seconds. You can always run it in VS Code

נבנה על ידיBuilt by Ariel Yohimovich