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 BossStructureThe Bosses Level-Structure (BossRoom).protected booleanThis boolean indicates whether the boss is harmless.protected GameElementThe target of the Boss.Fields inherited from class rekit.logic.gameelements.entities.Entity
invincibility, livesFields inherited from class rekit.logic.gameelements.GameElement
deleteMe, deltaTime, team, visible -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BossStub Factory method that everyGameElementmust implement in order to being able to be instantiated dynamically by the level creation.final voiddestroy()Method that, upon call, signals that thisGameElementis supposed to be deleted in the next logicLoop of theIScene.Get and set the boss structure.abstract StringgetName()Get the BossName.static final Set<? extends GameElement>Get all instances of BossPrototypes.Get initial position of theBossrelative to theBossStructurestop left corner.getZHint()protected voidThis method will calculate the next position of the Entity depending on the velocity.final voidsetBossStructure(BossStructure bossStructure) Set the bossroom-structure.final voidsetTarget(GameElement target) Set the target of the boss.Methods inherited from class rekit.logic.gameelements.entities.Entity
addDamage, collidedWithSolid, getLives, isVisible, logicLoop, setLivesMethods 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:EntityThis method will calculate the next position of the Entity depending on the velocity.- Overrides:
innerLogicLoopin 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 theBossrelative to theBossStructurestop left corner.- Returns:
- the relative start position of the
Boss.
-
create
Description copied from class:GameElementStub Factory method that every
GameElementmust 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
GameElementcan define and use is supplied. These are used make level creation able to determine theGameElementsbehavior. Note: the modifiers are not checked in syntax, so it must be thoroughly checked.- Overrides:
createin 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:GameElementMethod that, upon call, signals that this
GameElementis supposed to be deleted in the next logicLoop of theIScene.Note: The underlying
GameElementmight go through several collisions and be rendered multiple times before it is actually deleted.- Overrides:
destroyin classGameElement
-
getZHint
Description copied from class:GameElement- Overrides:
getZHintin classGameElement- Returns:
nullif no hint, otherwise the expected position
-