Package rekit.logic.gameelements.type
Class Boss
java.lang.Object
rekit.logic.gameelements.GameElement
rekit.logic.gameelements.entities.Entity
rekit.logic.gameelements.type.Boss
- All Implemented Interfaces:
Collidable
This class shall be extended in case of creating Bosses.
-
Nested Class Summary
Nested classes/interfaces inherited from interface rekit.logic.Collidable
Collidable.Optional
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BossStructure
The Bosses Level-Structure (BossRoom).protected boolean
This boolean indicates whether the boss is harmless.protected GameElement
The target of the Boss.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 TypeMethodDescriptionabstract Boss
Stub Factory method that everyGameElement
must implement in order to being able to be instantiated dynamically by the level creation.final void
destroy()
Method that, upon call, signals that thisGameElement
is supposed to be deleted in the next logicLoop of theIScene
.Get and set the boss structure.abstract String
getName()
Get the BossName.static final Set<? extends GameElement>
Get all instances of BossPrototypes.Get initial position of theBoss
relative to theBossStructures
top left corner.getZHint()
protected void
This method will calculate the next position of the Entity depending on the velocity.final void
setBossStructure
(BossStructure bossStructure) Set the bossroom-structure.final void
setTarget
(GameElement target) Set the target of the boss.Methods inherited from class rekit.logic.gameelements.entities.Entity
addDamage, collidedWithSolid, getLives, isVisible, logicLoop, setLives
Methods inherited from class rekit.logic.gameelements.GameElement
checkCollision, getDeleteMe, getFrame, getPos, getScene, getSize, getTeam, getVel, getZ, init, internalRender, isAddableToGroup, killBoost, reactToCollision, render, setPos, setScene, setSize, setVel
-
Field Details
-
bossStructure
The Bosses Level-Structure (BossRoom). -
target
The target of the Boss. -
isHarmless
protected boolean isHarmlessThis boolean indicates whether the boss is harmless.
-
-
Constructor Details
-
Boss
protected Boss()Create a Boss. -
Boss
Create a Boss.- Parameters:
startPos
- the start posvel
- the initial velocitysize
- the initial size
-
-
Method Details
-
getPrototypes
Get all instances of BossPrototypes.- Returns:
- a set of BossPrototypes
- See Also:
-
innerLogicLoop
protected void innerLogicLoop()Description copied from class:Entity
This method will calculate the next position of the Entity depending on the velocity.- Overrides:
innerLogicLoop
in classEntity
-
getName
Get the BossName.- Returns:
- the bossName
-
setBossStructure
Set the bossroom-structure.- Parameters:
bossStructure
- the bossroom-structure
-
setTarget
Set the target of the boss.- Parameters:
target
- the target
-
getBossStructure
Get and set the boss structure.- Returns:
- the boss-structure
-
getStartPos
Get initial position of theBoss
relative to theBossStructures
top left corner.- Returns:
- the relative start position of the
Boss
.
-
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.- Overrides:
create
in classGameElement
- Parameters:
startPos
- the initial position of the newGameElement
.options
- optional parameters that may determine additional behavior of theGameElement
.- Returns:
- the newly created
GameElement
.
-
destroy
public final void destroy()Description copied from class:GameElement
Method that, upon call, signals that this
GameElement
is supposed to be deleted in the next logicLoop of theIScene
.Note: The underlying
GameElement
might go through several collisions and be rendered multiple times before it is actually deleted.- Overrides:
destroy
in classGameElement
-
getZHint
Description copied from class:GameElement
- Overrides:
getZHint
in classGameElement
- Returns:
null
if no hint, otherwise the expected position
-