Sorry There I Haven't Added Pictures Yet, Read It Temporarily, I Will Add It Soon
Sorry There I Haven't Added Pictures Yet, Read It Temporarily, I Will Add It Soon
Introduction
Bomberman is a strategic, maze-based game that has been popular for a long time. Our team
decides to remake this well-known game for the OOP course to familiarize ourselves with OOP
concepts and gain more experience in using the library LibGDX – a framework for game
development written in Java.
Gameplay:
Like the original version, the player must place bombs to destroy all the enemies. To make
things easier and more interesting, the player can absorb PowerUps (like moving faster, range
explosion wider, placing more bombs at a time, …). The game ends when all the enemies are
destroyed (win) or the bomber is out of health (lose).
Control:
Press W/S/A/D to move UP/DOWN/LEFT/RIGHT
Press E to place a bomb
Rule:
- If the bomber collides with the enemy or is in range of the bomb explosion, then the
bomber loses 1 health.
- The initial bomber’s health is 3.
- If the bomber’s health is 0, the game ends.
- Bomber and enemy can’t go through the obstacle.
- There are 2 types of obstacles: solid and soft. The soft is destroyed when it collides with
the explosion, while the solid can’t be destroyed.
- There are some PowerUps during the gameplay, the bomber can easily get the
PowerUps just by passing it.
Game objects:
ScreenManager class: designed based on the singleton structure, the implication is that the
number of screens can only be one.
Abstract class Enemy and PowerUps: Those abstract classes are like a blueprint that allows us
to create different forms of Enemies and PowerUps and help us in improving the extensibility.
Abstract class AbstractScreen: Provide a few common methods between each screen, allowing
for extensibility without scarifying functionalities.
StageSelectScreen.java: we have 4 stages, this class gives 4 options to choose.
(read from here carefully, you can ignore the above details)
Item.java: an abstract class for Item. An item must be defined by height, width, and position (x,
y coordinate). It has functions to draw, move, and disappear.
Stage:
- GameStage.java: this class manages everything in the game. It defines the stage
background, status bar, and border size and contains the list of enemy, solid, soft, and
powerups.
- HUD.java: shows the stats of the game such as bomber’s health, speed, explosion range,
the number of bombs can be placed at the same time in the head of the screen.
- Soft.java: extends from Items class Soft can be destroyed by bomb explosion.
- Solid.java: extends from Item class, Solid can’t be destroyed.
- SpawnSoft.java: spawns softs.
- SpawnSolid.java: spawns solids
Player:
- Player.java: the main object that contains everything about the Bomber like moving,
placing bombs, and dead. It also tells us the current stats about the player such as:
speed, remaining bombs, and remaining health.
- PlayerInput.java: to receive the input from the player’s device and implement the
action according to the key code.
- PlayerAnimation.java: render every bomber’s action into the screen
- Explosion.java: to destroy things after a moment when the Bomb is placed.
- Bomb.java: extends from Items class, used to place bombs.
Enemy:
- Enemy.java: abstract class, that contains all the general properties of an enemy: speed,
health, position, etc. Function death() decrease the enemy’s health when it collides with
the explosion. This class used to be a parent class of all kinds of enemies, different
enemies have different properties, and we will discuss them below.
- Alien.java: Extends from Enemy.java, expected to move live longer than normal
- NinjaBlue.java: Extends from Enemy.java, expected to move faster than normal.
- Caveman.java: Extends from Enemy.java, expected to live longer than normal.
- EnemyAnimation.java: This class renders actions of the enemy into the screen, when an
enemy moves and dies.
- SpawnEnemies.java: to spawn the enemy at the chosen position, we place the enemy
by hand through this class.
PowerUps:
- PowerUps.java: an abstract class that contains basic information like position, border
width, border height. When the Bomber passes it, function del() makes the PowerUps
disappear, and function execute() applies new ability to the Bomber.
- FireUps.java: to increase the range of explosion.
- IncreaseBomb.java: to increase the number of bombs can be placed at a time.
- IncreaseSpeed.java: to increase the speed of the Bomber.
- SpawnPowerUps.java: to place the PowerUps somewhere in the map.
Game Interface
Architecture
1.Screen
2. Player