Capsule Clash
Capsule Clash is a 2 player strategy game where players select units to fight each other with on a turn based board.
Github url: https://github.com/cpe305/fall2016-project-morteriser
Description
Each player begins with their selected units.
Player 1 begins their turn and is able to:
-
Select a unit they own:
- Select to Move:
- Select a tile to move to. Able to Attack afterwards or end the turn.
- Select a tile to move to. Able to Attack afterwards or end the turn.
- Select to Attack:
- Select a tile to attack if possible. Will end the turn afterwards.
- Select a tile to attack if possible. Will end the turn afterwards.
- Select to end turn.
- Select to Move:
Player 1's turn then ends, and player 2's turn begins, giving them the same choices to follow.
After an attack is dealt the units will lose health based on the damage it will take. When a unit no longer has any health it will be removed from play. A player wins once all the opposing units are gone or they have the highest overall health of all their units should 50 turns have based for both players.
System Architecture
3-Tier Layered Architecture:
UML Diagram
Class Diagram:
Design Patterns
Singleton Pattern:
- Used for FigurineCollection and Renderer classes. Both can only be instantiated once due to creating a lot of expensive objects that are specific to what is read from an xml document. In the case of Renderer, the Texture class takes a lot of resources to create and using Singleton prevents the need to create it each time. While the FigurineCollection is meant to be used by many classes whenever it wants a reference to any of the possible figurines, preventing the need to instantiate all existing ones for each class that wants to look.
Strategy Pattern:
- Used for Action interface. Allows Figurines to have different actions that they can take by implementing different classes to do each separate functionality. The application of this is how StandardAction calculates the damage based on your attack and the target's defense, while PierceAction calculates the damage based on your attack while ignoring the target's defense.
Factory Method Pattern:
- Used for ActionFactory class. Allows the creation of a certain type of Action for each Figurine based on what was read in the xml document of FigurineCollection. This allows the document to say something simple like "standard" to then have the factory interpret that as instantiating a StandardAction class to put as that Figurine's Action.
Observer Pattern:
- Used on MainGame and Board classes. Board is the Subject while MainGame is the Observer, as Board deals with all the logic in the game while MainGame deals with the graphics and user input. Whenever a change occurs in board, it notifies the MainGame to inform it to change what it displays.
Tools Used
- Libgdx
- Gradle
Contact
E-mail: hstoytch@calpoly.edu Alternative e-mail: christoytchev@gmail.com