- Clone the repository
git clone https://github.com/MujyKun/basic2dengine.git
- Go to the repo directory
cd basic2dengine
- Running with Python ^3.9 is recommended.
- Install requirements (the only dependency should be pygame) with either
pip install -r requirements.txt
- If you do not have pip, you can install it with
python get-pip.py
orpython -m ensurepip --upgrade
- If you do not have pip, you can install it with
- If you have poetry you can use
poetry install
.
- Start the program with
python run.py
The game can be found in brickbreaker.py. Here are a few things to note:
- The floor will kill the ball.
- Use the spacebar key to spawn new balls.
- The amount of bricks/tiles are decided based on the screen resolution.
- You can use the Left or Right keyboard arrow key to move the platform respectively.
- You can play background music by typing
m
on the keyboard. - You can pause/unpause the background music by typing
p
on the keyboard. - You can stop the background music by typing
s
on the keyboard.
Here is a gif of an example run: This example run may appear a bit slow because of the recording software, but also the game was rendered at 1080p. It is a lot smoother at 720p which is now the default on run.
There are tests for collisions in test.py that could be run. Canceling out of one screen will open another.
Here is a gif of an example run: