Package rea.gameplay.games
Class EasterEggRace
java.lang.Object
rea.gameplay.games.EasterEggRace
- All Implemented Interfaces:
Gameplay
A simple game where the player has to collect all the Easter eggs in the lawn.
* @author José Paulo Leal
jpleal@fc.up.pt
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
The background height(package private) static final int
The background width(package private) static final int
The height of an Easter egg(package private) static final Visual[]
The visual representation of some Easter eggs(package private) static final int
The width of an Easter egg(package private) static final Visual
The visual representation of the lawn used as a background -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
gamedEnded
(GameMap gameMap) Game ends when there are no more eggs to collectThe avatars available for this game: cartoon avatars.A long description of the game.int
Only a single playerint
At least 1 player is requiredgetName()
The name of the game as a short string.Produce a map for a game instance.
-
Field Details
-
BACKGROUND_WIDTH
static final int BACKGROUND_WIDTHThe background width- See Also:
-
BACKGROUND_HEIGHT
static final int BACKGROUND_HEIGHTThe background height- See Also:
-
LAWN_VISUAL
The visual representation of the lawn used as a background -
EGG_WIDTH
static final int EGG_WIDTHThe width of an Easter egg- See Also:
-
EGG_HEIGHT
static final int EGG_HEIGHTThe height of an Easter egg- See Also:
-
EGG_VISUAL
The visual representation of some Easter eggs
-
-
Constructor Details
-
EasterEggRace
public EasterEggRace()Create a new instance of the game
-
-
Method Details
-
getName
Description copied from interface:Gameplay
The name of the game as a short string. -
getDescription
Description copied from interface:Gameplay
A long description of the game.- Specified by:
getDescription
in interfaceGameplay
- Returns:
- description of the game
-
makeGameMap
Description copied from interface:Gameplay
Produce a map for a game instance. A map is a collection of interconnected places. This method returns the place where the game starts. When players enter the game they will be in this place The place can (and should) be connected to other places. Each invocation of this method must return a new instance, although with a similar structure.- Specified by:
makeGameMap
in interfaceGameplay
- Returns:
- the place where the game starts
-
getAvatars
The avatars available for this game: cartoon avatars.- Specified by:
getAvatars
in interfaceGameplay
- Returns:
- set of cartoon avatars
- Implementation Note:
- The avatars are the enum constants of the
CartoonAvatar
class
-
getMaxPlayers
public int getMaxPlayers()Only a single player- Specified by:
getMaxPlayers
in interfaceGameplay
- Returns:
- 1
-
getMinPlayers
public int getMinPlayers()At least 1 player is required- Specified by:
getMinPlayers
in interfaceGameplay
- Returns:
- 1
-
gamedEnded
Game ends when there are no more eggs to collect- Specified by:
gamedEnded
in interfaceGameplay
- Parameters:
gameMap
- for this game instance- Returns:
true
if the game has ended,false
otherwise
-