Class Life
java.lang.Object
rekit.logic.gameelements.GameElement
rekit.logic.gameelements.entities.Entity
rekit.logic.gameelements.type.Pickup
rekit.logic.gameelements.entities.pickups.Life
- All Implemented Interfaces:
Collidable
This class defines a simple
Pickup
; a Life which will give the
player lives.-
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionStub Factory method that everyGameElement
must implement in order to being able to be instantiated dynamically by the level creation.void
Template method that will be called periodically after being added to aIScene
.void
perform
(GameElement collector) Template method that should be overwritten in concretePickups
to add the action that is performed upon being collected by the Player.Methods inherited from class rekit.logic.gameelements.type.Pickup
getPrototypes, innerLogicLoop, 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
-
Life
public Life()Prototype Constructor. -
Life
Instantiate a Life by start position.- Parameters:
startPos
- the start position
-
-
Method Details
-
perform
Description copied from class:Pickup
Template method that should be overwritten in concretePickups
to add the action that is performed upon being collected by the Player. -
internalRender
Description copied from class:GameElement
Template method that will be called periodically after being added to a
IScene
. Must be as performant as possible to keep the FPS low, since it will be called in every render-loop.Should be overwritten in sub classes for custom visualization using the
GameGrid
.- Overrides:
internalRender
in classGameElement
- Parameters:
f
- theGameGrid
that represents the games field and supplies primitive drawing operations.
-
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 classPickup
- Parameters:
startPos
- the initial position of the newGameElement
.options
- optional parameters that may determine additional behavior of theGameElement
.- Returns:
- the newly created
GameElement
.
-