This is a simple experiment to test collisions in pygame.
The game is a minimalistic 2D airplane simulator where the player can move the airplane up and down with the arrow keys.
Mountains are randomly generated and the player must avoid them.
โ
or w
โ Move the airplane up
โ
or s
โ Move the airplane down
โ
or a
โ Decelerate the airplane
โ
or d
โ Accelerate the airplane
Esc
โ Quit the game
Space
โ Restart the game (when the game is over)
To win the game, the player must avoid the mountains and land the airplane on the ground.
Python
3.x +
Pygame
2.x +
git clone [email protected]:iserk/pygame_collisions.git
cd pygame_collisions
pip install -r requirements.txt
python main.py
This program uses a simple collision detection algorithm that checks if two polygons are overlapping.
The algorithm is based on the Separating Axis Theorem.