Parking 2D is a university project
that allows
the work with pygame
to create a game in python
.
This project demonstrates how to work with pygame and create a game including
- a menu created with pygame-menu
- collision detection
- map creation
- saving achieved scores and much more..
If you have any suggestions for improvement, please feel free to contact me.
Before you begin, ensure you have met the following requirements:
- You have installed (still) installed all default libaries coming with python (json, csv, pickle)
- You have installed the requiered libaries listed in src\requirements.txt
- To do so you can try
pip install -r requirements.txt
- You have installed python
- This project was tested on python==3.8.0 and it is recommended to use this version
To install Parking 2D, follow these steps:
- Download this repository
- Unzip the downloaded file
To use Parking 2D, follow these steps:
- open main.py
- run main.py and the game should start
OR
- Start a terminal within the src folder of this project.
- Type the following command in your teminal.
C:\src>python main.py
- Your starting screen should look something like that
- Maps are created with tiles
- For creating a map a level editor is highly recommended
- A free level editor is Tiled
- Create a new map
⚡ Change the "tile size" to 16x16 and the "map size" to Width=50tiles and Height=38tiles |
---|
- Open a new tileset from images\maps\customSpriteSheet.png in your level editor
- Create a map with the given 16x16 tiles
- Please note that all black, green and grey blocks are going to be obstacles in the game
❗ Your map must include one (just one) brown tile that represents the top left corner of your goal |
---|
- How Big the goal is going to be should be saved in a variable with the numbers of tiles in x and y direction (default is x:6, y:12)
- Your created map with JUST the blocks from images\maps\customSpriteSheet.png should then look something like this.
- Export this file as csv and the obstacles are done. Now you can start designing your layout
- Copy your level and add assets, pictures or text on your level
- Export your copy as an image and the surface the user is going to see is done.
- Your map is now ready to be included into the game and could look something like this.
- Files that you need at the end
- A csv that includes the layout of your map (created with just the tiles provided in images\maps\customSpriteSheet.png)
- An image that shows the design of your map
You can also start with making a design and afterwards filling it with the tiles provided in images\maps\customSpriteSheet.png)
This project is just for personal and educational use. It is not intendet to earn any money with this project.
- Background: Designed by vectorpouch / Freepik
- Cars: [email protected]
- Futuristic sprite pack: by Skorpi
- Race sprite pack: by Kenney Vleugels for Kenney
- Font: by Vic Fieger
- Honk noise: by YouTube
- Game music: by Luis Zuno (@ansimuz) | Patreon
To contribute to Parking 2D, follow these steps:
- Fork this repository.
- Create a branch:
git checkout -b <branch_name>
. - Make your changes and commit them:
git commit -m '<commit_message>'
- Push to the original branch:
git push origin <project_name>/<location>
- Create the pull request.
Alternatively see the GitHub documentation on creating a pull request.
If you want to contact me you can reach me at Linkedin.
This project uses the following license: MIT.