Tank War Game Design in Java
A Classic tank game implemented with Java Swing. The game supports one player tank and several types of Aitank. All tank has 7 healthPoint initially, hitting by a shell will decrease it by 1.
Dumb AI Tank: Will always moves in a circle, shoot at random time.
Turret AI Tank: Will always faces the player tank, shoot at random time.
Cushion AI Tank: Will always faces the player tank, and keep the distance in a range, shoot waits 300 frames.
Player tank can move forward, backward, turn and shoot according to the keyboard input
Extra features implemented:
Power up: Tank can pick up "Power up" and increase its healthPoint by 5, increase its speed to speed x 2. Better collision detection: Confine pair combinations to unique ones instead of using brute-force approach. Animations: Add animations when shell hits a target Game UI: Tanks' HP and player tank's speed are shown on the bottom of the screen. Sound Effects: Sound Effects are added to the conditions below:
- - player tank shoots
- - pick up powerup
- - tank explosion
- - wall explosion
- - player wins
- - player loses
- - Background Music is added, but still need to work on it. (It only plays once if the game is not over. And it can't stop when game is over if it hasn't finish playing once. )