After analyzing the Bomberman online game structure, in the design phase, we listed out all the necessary classes that will be using in building the game and designed their UML diagrams as the followings:

 

What Classes we need?

First, we need a BombermanClient class that handles the client side. It handles the connection with the server.This class also includes an inner class that takes care of the authentication. User will not be able to get into the game if login failed but they can create new account and save into the game’s database.The hostPayer will set to true if that is the 1st player that successfully logged into the game. He/she then determines the game setting. For example, how many players should be in a game, time limit and select game field.

The sendMove() and receiveMove() methods synchronizes the movement of other players.

 

The Player class is used to created player objects. It contains fields that will store player information that retrieved from the game database.The value stored in movingSpeed, numOfBomb, bombType, bombPower, alive, and isAbleToMove will change when a player gets a corresponding item.The location indicates the current coordinates of a character.

The Player class includes all the methods that are necessary to control the movement of a character.

The checkBock() method determine if any block that blocking the player to move.

The reset() method changes all the items that a player collected to 0.

The Field class is for creating a field object that based on the fieldID the hostPlayer selected.The randomBlocksDistribution() and randomItemsDistribution() method place the blocks and items in random places.
The Bomb class simulates the bomb object.Since the kickBomb item allows a player to move bombs, this class also includes methods that can control the bomb’s movement.The explose(bombPower: int) method will automatically executes after 4 seconds of the object is created. It makes the objects that in the four directions, and destroy them.
The Block class is used for creating block objects.
The Item class is for creating all kind of items that based on the itemType.Items will be randomly created in locations based on the randomItemDistribution() in the Field object.The itemEffect(itemType: int) method will change the value of collected item on a player object.

Finally, we need a server class to handle the interaction with all the client applications.

For the Game Database, we have 3 tables to store server information, user profile, and game history for each user:

 

« »