Class Checkpoint
java.lang.Object
com.codename1.gaming.platformer.LevelEntity
com.codename1.gaming.platformer.Checkpoint
A checkpoint: touching it moves the player's respawn point here.
-
Field Summary
Fields inherited from class LevelEntity
h, w, x, y -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPhase()A small number the view reads to pick a frame: open or closed, lit or not, how cracked.longhashState(long h) Mixes the entity's play-relevant state into a hash.voidonTouch(PlatformWorld world, Actor c) Called each tick a living actor overlaps the entity.Methods inherited from class LevelEntity
deactivate, getId, getTouchMargin, getType, isActive, onAdded, step
-
Constructor Details
-
Checkpoint
Creates a checkpoint.
Parameters
id: the idx: left, fixed pointy: top, fixed pointw: width, fixed pointh: height, fixed point
-
-
Method Details
-
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
-
onTouch
Description copied from class:LevelEntityCalled each tick a living actor overlaps the entity.
Parameters
world: the worldc: the actor
- Overrides:
onTouchin classLevelEntity
-
hashState
public long hashState(long h) Description copied from class:LevelEntityMixes the entity's play-relevant state into a hash. The default mixes the position and whether it is active.
Parameters
h: the running hash
Returns
the updated hash
- Overrides:
hashStatein classLevelEntity
-