2024 (Autumn) Pygame workshop SOLUTION and SPEC, blanks will go on a new branch later on
- Install python extension
![Screenshot 2024-04-18 at 4 56 50 pm](https://private-user-images.githubusercontent.com/96902642/323763907-a6cfe1c5-cd5c-4751-84d2-190b0906b271.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NzgwNzgsIm5iZiI6MTczOTQ3Nzc3OCwicGF0aCI6Ii85NjkwMjY0Mi8zMjM3NjM5MDctYTZjZmUxYzUtY2Q1Yy00NzUxLTg0ZDItMTkwYjA5MDZiMjcxLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIwMTYxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRmZGZjMmIxM2ExZTdiZmQwNjFlNzk5ZjE0NjMxZGM4Y2JiNWJhZTYyNWFhOTY0MjA3NjllNWY3ZGM2MGIzYzAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nCB8faY4ulAe06x2jBnsZr9A5ZO4tu65claND6jDUVE)
![Screenshot 2024-04-18 at 5 00 16 pm](https://private-user-images.githubusercontent.com/96902642/323763971-476ce84a-feb5-4276-8e4e-16c7f4cf7522.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NzgwNzgsIm5iZiI6MTczOTQ3Nzc3OCwicGF0aCI6Ii85NjkwMjY0Mi8zMjM3NjM5NzEtNDc2Y2U4NGEtZmViNS00Mjc2LThlNGUtMTZjN2Y0Y2Y3NTIyLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIwMTYxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTEzZDk4MmMwNzYwMTM0Njg0MTYxODkxNTljMzM2MGU3ZjE0NGY5YTZkMDFiY2IyYTNiZGQxYjRjNmM4MTM1MTgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.nW4QUgVUB2ToJNPHLXK079_aQVpdYDfBRcR82QHLbhI)
- Press play on main.py!
![Screenshot 2024-04-18 at 5 03 08 pm](https://private-user-images.githubusercontent.com/96902642/323764067-834baa2d-d7b8-4a64-9c39-138f8302e9cd.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NzgwNzgsIm5iZiI6MTczOTQ3Nzc3OCwicGF0aCI6Ii85NjkwMjY0Mi8zMjM3NjQwNjctODM0YmFhMmQtZDdiOC00YTY0LTljMzktMTM4ZjgzMDJlOWNkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDIwMTYxOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWY3MDk5ZjEzMDQ3NzNkZmRmZGY0NjFlYWU3ZDQwNzI4MTc1MTIyZjhkYzE1ZDNlNzI4YzIxNGNiMTgwMjUwMWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.SoLCDgz5qkw1L23BHwFfl_R9LM8CIFuwzFINKZ3ArSU)
You need to make sure you have python3
and pygame
installed.
Install python3
with the installer or package manager of your choice, pip (python package manager) will come installed by default.
Check that python3 is installed:
$ python3
Python 3.11.7
Install the pygame module using pip3 install pygame
/ pip install pygame
(should be installed globally by default, but if you have a venv set up you will have to make sure it is installed in the venv)
To check that you've successfully installed pygame run the following commands (or you could just try running the program):
$ python3
Python 3.11.7 ...
Type "help", "copyright", "credits" or "license" for more information.
>>> import pygame
pygame 2.5.2 (SDL 2.28.3, Python 3.11.7)
Hello from the pygame community. https://www.pygame.org/contribute.html
You can either click the Run
button on vscode, or
$ cd 2024-Autumn-Pygame
$ python ./main.py
Feel free to move around/change/add/remove files! The files are somewhat grouped up but i'm not 100% sure if the layout is intuitive
main.py
- Where the game is initialised and program is run, might be a good idea to abstract away as much functionality into separate files/functions if possiblespec/
- For now, if you want to write up some documentation for your code just create a new.md
file and dump your notes. We will also put the cleaned up and properly fomatted spec there. Any images in the spec should be in thespec/images/
foldersprites/
- Assets for the game, for development purposes i have created some placeholder sprites that have collision boxes outlined to make life easier insprites/temp/
. plsplspls make sure we are using proper sprites for the actual workshopsrc/
- code in general should go here- general constants can go in
src/constants.py
- classes/objects/tiles in
src/entities/
- maybe an intro or ending scene asw in
src/scenes/
? maybe maps in here idk
- general constants can go in
- tile size is 64px * 64px
- board size is 10 x 14 tiles
- player movement should be setup, player's get_x() and get_y() return their center position, otherwise coordinates will be the top left corner (not tested)