NAME : MAYANK GUPTA
The program has been divided into five files:-
Contains the designs of robot,bomb,diffuse codes used in the game
Gives a brief introduction of the game
Give detail about various keys to be used in the game
A reference to me
Contains the main game code. Imports/runs other modules if and when necessary.
An object of this class when initallized,has all the keys to be used in the game with particular movement.
An object of this class when initallized, returns a screen of max size possible,with a specific border.
when this is called it end the window
when this is called it clear the window,and put the bolrder again
if called return the the window created
This class is used to to generate enemies at random places
It generates random coordinates for enemy placement
check if at that particular coordinate already something is present
It moves the enemy robot
returns the position of enemy
This class is used to generate user robot
moves the robot in the field according to user
returns the robot current position
returns the characters at current position of robot
Class which is used to get introduction window
displays the choices which you have in game
displays the choices which you have in game
select the robo of your choice
select the bomb and diffusecode of your choice
This class is used to plant bomb and diffuse code
check if at that particular coordinate already something is present
display the bomb and diffusecodes at desired places
plants bomb and diffusecodes at random places
The main game code resides in the bombDefuser.py
file.This file first import all the required library and design.py file.
First the intro class is called which generates the introduction screen , then by pressing different keys different screens comes.
By pressinf 1 the game starts.Now all the remaining classes object are initallised.The robot is placed at inital position.
Then a loop is run till the number of levels are less then particular number or life not equal to zero or flag not equal to one.
In this loop bomb and diffuse codes are planted and enemy are generated at random places.Insides this there is another loop which
wait for user input for predefined interval of time. If no input is received during this period, it continues with the previous input.
If p or P
key is pressed it pauses
the game by entering into a while loop which breaks when p or P
is pressed again.A count of
bomb and diffuse codes is mainted when all diffuse codes are collected and then all bomb are collected the next level begins.
Flags are set accordingly to bomb and diffuse code count.If number of life is zero
and flag equal 1 or 2
game ends.
If the player is unsuccessful, the code a
Game Over
message is displayed along with level
and score
. Otherwise, a congratulations message
is displayed along along with level
and score
.
- You can choose any robot from given choice as your enemy by just entering setting field
- You can choose any robot from given choice as your robot by just entering setting field
- You can choose any type of diffuse code from given choice according to your liking by just entering setting field
- You can choose any bomb from given choice according to your liking by just entering setting field
- After completing each level, in next level there will be one exta bomb to diffuse, one extra enemy to tackle,two extra code to collect.