Class Door
java.lang.Object
com.codename1.gaming.platformer.LevelEntity
com.codename1.gaming.platformer.BlockEntity
com.codename1.gaming.platformer.Door
A locked door: solid until the player touches it holding the key it names,
which is used up.
-
Field Summary
Fields inherited from class LevelEntity
h, w, x, y -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetKey()The key that opens the door.intgetPhase()A small number the view reads to pick a frame: open or closed, lit or not, how cracked.voidonAdded(PlatformWorld world) Called once when the entity is added to a world, before the first step: the place to write solid cells.voidonTouch(PlatformWorld world, Actor c) Called each tick a living actor overlaps the entity.Methods inherited from class BlockEntity
getTouchMargin, hashState, isSolid, setSolidMethods inherited from class LevelEntity
deactivate, getId, getType, isActive, step
-
Constructor Details
-
Door
-
-
Method Details
-
getKey
The key that opens the door.
Returns
the key name
-
getPhase
public int getPhase()Description copied from class:LevelEntityA small number the view reads to pick a frame: open or closed, lit or not, how cracked. The default is 0.
Returns
the visual phase
- Overrides:
getPhasein classLevelEntity
-
onAdded
Description copied from class:LevelEntityCalled once when the entity is added to a world, before the first step: the place to write solid cells. The default does nothing.
Parameters
world: the world
- Overrides:
onAddedin classLevelEntity
-
onTouch
Description copied from class:LevelEntityCalled each tick a living actor overlaps the entity.
Parameters
world: the worldc: the actor
- Overrides:
onTouchin classLevelEntity
-