Class DefaultCoin
java.lang.Object
rekit.logic.gameelements.GameElement
rekit.logic.gameelements.entities.Entity
rekit.logic.gameelements.type.Pickup
rekit.logic.gameelements.type.Coin
rekit.logic.gameelements.entities.pickups.DefaultCoin
- All Implemented Interfaces:
Collidable
This class represents default coins.
-
Nested Class Summary
Nested classes/interfaces inherited from interface rekit.logic.Collidable
Collidable.Optional
-
Field Summary
Fields inherited from class rekit.logic.gameelements.entities.Entity
invincibility, lives
Fields inherited from class rekit.logic.gameelements.GameElement
deleteMe, deltaTime, team, visible
-
Constructor Summary
ConstructorsModifierConstructorDescriptionPrototype constructor.protected
DefaultCoin
(Vec startPos) Constructor with position. -
Method Summary
Modifier and TypeMethodDescriptionStub Factory method that everyGameElement
must implement in order to being able to be instantiated dynamically by the level creation.protected RGBAColor
getColor()
Get the main color of the coin.protected RGBAColor
Get a darker version of the colorCoin.getColor()
for the edge of the coin.protected int
getValue()
Get the value of the coin.Methods inherited from class rekit.logic.gameelements.type.Coin
getPrototypes, innerLogicLoop, internalRender, perform
Methods inherited from class rekit.logic.gameelements.type.Pickup
reactToCollision
Methods inherited from class rekit.logic.gameelements.entities.Entity
addDamage, collidedWithSolid, getLives, isVisible, logicLoop, setLives
Methods inherited from class rekit.logic.gameelements.GameElement
checkCollision, destroy, getDeleteMe, getFrame, getPos, getScene, getSize, getTeam, getVel, getZ, getZHint, init, isAddableToGroup, killBoost, render, setPos, setScene, setSize, setVel
-
Constructor Details
-
DefaultCoin
public DefaultCoin()Prototype constructor. -
DefaultCoin
Constructor with position.- Parameters:
startPos
- the position.
-
-
Method Details
-
getColor
Description copied from class:Coin
Get the main color of the coin. -
getDarkerColor
Description copied from class:Coin
Get a darker version of the colorCoin.getColor()
for the edge of the coin.- Specified by:
getDarkerColor
in classCoin
- Returns:
- the darker color
-
getValue
protected int getValue()Description copied from class:Coin
Get the value of the coin. -
create
Description copied from class:GameElement
Stub Factory method that every
GameElement
must implement in order to being able to be instantiated dynamically by the level creation.A startPos must be supplied to position the new GameElement right.
Also, an array of modifiers that the extending
GameElement
can define and use is supplied. These are used make level creation able to determine theGameElements
behavior. Note: the modifiers are not checked in syntax, so it must be thoroughly checked.- Specified by:
create
in classCoin
- Parameters:
startPos
- the initial position of the newGameElement
.options
- optional parameters that may determine additional behavior of theGameElement
.- Returns:
- the newly created
GameElement
.
-