Skip to content

A 2D tank game developed in Java using JavaFX to demonstrate OOP design principles. Players control a tank to battle against AI-controlled tanks. The game features smooth movement, collision detection, AI opponents, power-ups, and various obstacles.

Notifications You must be signed in to change notification settings

Choconaut/tank-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

A 2D tank game developed in Java using JavaFX to demonstrate OOP design principles. Players control a tank to battle against AI-controlled tanks. The game features smooth movement, collision detection, AI opponents, power-ups, and various obstacles.

Table of Contents

Features

  • Player-Controlled Tank: Navigate through the battlefield and engage enemy tanks.
  • AI-Tanks: AI opponents that track and attack the player and allied tanks.
  • Obstacle Interaction: Walls and obstacles that tanks and missiles cannot pass through.
  • Power-Ups: Collectible items like medpacks to restore currentHealth.
  • Collision Detection: Collision handling between tanks, obstacles, missiles, and power ups.

Gameplay

Up: Up Arrow Key
Down: Down Arrow Key
Left: Left Arrow Key
Right: Right Arrow Key
Space: Fire Missile (has a cooldown)

Requirements

To run this project, you need:

  • Java Runtime Environment (JRE) or Java Development Kit(JDK) 21 or higher

Setup Instructions

  1. Download the JAR file. Get the latest version of TankGame.jar from the Releases page.
  2. Navigate to the directory where TankGame.jar is located.
  3. If using terminal/command prompt, execute the following:
java -jar TankGame.jar

Notes:

  • Ensure that java is accessible in your system's PATH if you're using the terminal/command prompt.

Project Structure

UML Diagram Tank Game-2024-11-28-013912

Key Components

  • GameObject: Ensures consistent behavior across all game entities, such as tanks, walls, and powerups.
  • GameObjectManager: Oversees the game logic, manages the state of game objects, and handles overall game flow.
  • GameObjectFactory: Responsible for the creation of all gameObjects.
  • TankController: Allows user input to interact with playerTank movement.

About

A 2D tank game developed in Java using JavaFX to demonstrate OOP design principles. Players control a tank to battle against AI-controlled tanks. The game features smooth movement, collision detection, AI opponents, power-ups, and various obstacles.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages