========================================================
By Meher Shashwat Nigam
This is a terminal based implementation that tries to simulate the classic Super Mario
Written in python3 without using pygame and curses.
Only colorama has been used to bring in colours.
The game has been tested only on Linux based operating systems, may not work on Windows.
Sounds have been added.
- First, install all the requirements
pip install -r requirements.txt
- Running the game using python3
python3 game.py
Select the level you want to play by entering 1, 2 or 3 when prompted.
Mario has 3 lives. Make sure they count.
Higher levels have :
- Higher gravity
- More enemies
- Faster enemy movement
- More coins ;)
You can move mario around using the following controls(make sure CAPS_LOCK is off):
d
orright arrow
to move righta
orleft arrow
to move leftw
orup arrow
orSpace_bar
key to jumpq
to quit the game
Mario can collect coins as it moves --- 200 points
Mario can kill enemies by jumping over them. Enemies reduce lives by one if they hit mario from the side; but also die in the process --- 500 points
A base score is generated according to the maximum distance traveled in the game.
Mario doesn't know how to swim! Mario dies instantly after it falls into the pit.
The game has been written keeping in mind OOP principles.
The application demonstrates inheritance, encapsulation and polymorphism.
- There are three major classes:
Scene
,Person
andObstacle
Mario
andEnemy
are derived classes of thePerson
class defined in people.py- Each obstacle/item (
Walls
,Pits
,Clouds
,Grass
,Coins
) inherits from theObstacle
class in obstacles.py - The
Scene
class holds the full map and all object matrices are blitted into its matrix defined in scene.py - The config.py file holds the constant values and variables used throughout the game, in one place
- Game.py holds the main game engine, and has all object initializations.
- scene_gen.py makes the basic scene by blitting walls, pits, grass and clouds onto the scene
- gamefunctions.py has all necessary gamefunctions like checking object clashes and blitting one matrix over the other after updating
- input.py defines how character input is taken at runtime
- Code is PEP8 compliant