In this work, I've created a terminal game which is very similar to Jetpack Joyride in concept.
I could have easily gotten away by making the objects and the game engine to just suit this game, however, I decided to take the approach of building as general of a game engine as I could which included a shape agnostic physics engine that not only registers 99.9% of all collisions but also follows the Separating Axis Theorem (SAT) to find out the Minimum Push Vector for each collision.
The physics engine also includes a parameterised gravity, drag forces and radial forces for the magnets. A huge amount of detail was paid to even implement terminal velocity for the player objects. A complete acceleration and velocity physics is also implemented
Moreover the object system was inspired from Unreal Engine's Object Classification. The classes were so defined to be as generalized as possible.
Some shortcuts were taken and the generalization was sacrificied so as to ensure that the program ran smoothly on the terminal screen.
- Make sure that you have Python 3.7.3+ and the required Python libraries. If you don't you may install them using:
pip install -r requirements.txt
- Navigate into the
game_files
folder and run the following command to start the game:
python3 game.py
- Make sure that you have your terminal with a size of atleast
31 x 171
to run the game. I would recommend a size of46 x 171
as that was one used while development.
W
: to move upwards using JetpackA
: to move left using JetpackD
: to move right using JetpackE
: to fire the bulletG
: to spawn Mr.Cuddles for the playerspace
: to activate the Player Shield
- Ground: The ground is present below the player at all times throughout the game.
- Solid Objects: These are obstacles that are placed so as to slow down the player. It does not take away a life from the player.
- Firebeams: These are obstacles that have been modified from solid objects to cause the player to lose life on impact.
- Magnets: These are obstacles that attract the player radially towards themselves.
- Coin: A collectible that will increase the score of the player.
- Speed Boost: A collectible that will increase the game speed.
- Shield: The player will be able to activate his shield which will provide him invincibility.
- Player Bullets: The player can shoot these which will destroy the obstacles (except the magnet) on impact. They also cause damage to the boss enemy.
- Boss Enemy: The boss enemy spawns near the end of the game and fires player tracking bullets to the player. The boss enemy will follow the player along the Y axis.
- Player Dragon (Mr.Cuddles): The player can spawn its own dragon which will cause the game to speed up and will provide shield after to the player.
- The game has a
time
system and the player has to complete the game within the time. - The game has color implemented using
colorama
andANSI Sequences
. - The game does not use
curses
or anycurses
based libraries such aspygame
.
- Currently the terminal game only works for
Linux Terminals
. Can work on to port it to theWindows Powershell
. - Implement a procedurally random generation algorithm instead of a simple random generation system.
- Improve aesthetics of the game.