Tank War Game

Tank War Game is a two-player tactical game played on a grid-based map, where each player controls a tank with the objective of depleting the opponent's life points to zero. The game incorporates movement, shooting mechanics, and a shrinking map to intensify gameplay over time.


Game Setup

Initial Configuration

Game Modes


Gameplay Flow

  1. Player Input:

    • Players input their actions simultaneously.

  2. Action Execution:

    • Tanks perform their chosen actions (turning and moving).

  3. Tank-Tank Collision Check:

    • The game checks if tanks occupy the same grid space and processes collisions accordingly.

  4. Bullet Generation:

    • If it's a bullet-firing turn (every third turn), bullets are spawned.

  5. Bullet Movement and Collision:

    • Bullets move in two steps, with collision checks after each step.

    • Bullets hitting tanks deduct 2 life points from the tank.

  6. Boundary Check:

    • Tanks outside the boundary lose 1 life point.

    • Bullets outside the boundary are removed.

  7. Game End Check:

    • The game checks if any tank's life points have reached zero.


Tank Mechanics

Movement and Actions

Example

If a tank is at position (5,5) facing down (2):

Tank-Tank Collision


Bullet Mechanics

Bullet Generation

Tank-Bullet Collision

If a bullet lands on a tank's position, it reduces that tank's life by 2 points and the bullet is removed.

Before the bullet movement step, the game checks for collisions with tanks.

After each bullet movement step, the game checks for collisions with tanks.

Bullet-Bullet Collision

Example


Map Boundaries and Shrinking Mechanism

Initial Boundary

Shrinking Map

Boundary Penalties


Winning Conditions