Skip to content

yangwonlohengramm/Tanks

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

Tanks

#Game Description

TANKS is a recreation of various classic tank games. The main objective of this game is to destroy the opponent’s tank. This can be accomplished by depleting the opponent’s hit points.

Each tank has ten hit points initially. Successfully landing a shot on the opponent will cost them two hit points. Ramming into the other tank will deal two hit points of damage to both tanks. If you successfully shoot the other tank but are too close, you will take a hit point of damage. If any shots collide, they will destroy each other and any ammo that hits the walls will also be destroyed. Hitting a wall will stop your tank but no damage is dealt. A player’s colour determines the colour of their tank and ammo. Player 1 starts at the bottom left of the map while Player 2 starts in the top right corner.

In order to win, make your opponent lose all their hit points.

#Instructions for Playing the Game

Once you open the “TANKS.py” in IDLE, press F5 to run the code. You will be presented with a screen that has the options, “1 Player Mode” and “2 Player Mode.”

Using your mouse, click inside the box containing the mode you would like to play. After selecting your mode, a countdown will take place. Hit points, health bars and player colours are displayed on the top of the screen. A player’s colour is indicated beside their HP label. The colour of a player’s health bar is determined their health level.

Player 1 controls their tank by pressing the “w” key to move their tank forward, the “s” key to move the tank backwards, the “a” key to turn the tank left and the “d” key to turn the tank right. Releasing any of these “movement” keys will stop the tank from moving in that direction. Player 1 must press “q” to shoot. Releasing the “q” key will stop the firing process.

If “2 Player Mode” has been selected, the second player must press the “Up” arrow key to move their tank forward, “Down” key to move backwards, “Left” key to turn left and the “Right” key to turn right. Player 2 must press “m” to shoot. If any “movement” key is released, Player 2’s tank stops moving in that direction and if “m” is released, Player 2’s firing process stops. If “1 Player Mode” has been selected, an AI will take control of Player 2’s tank.

Click on the circle in the middle of either tank to change that player’s colour. Press the “Escape” key to exit at any time during the battle. Once a player has been defeated, the winner is declared and the game ends.

About

A game of tanks created using Python 3.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages