Class Gate
java.lang.Object
com.codename1.gaming.platformer.LevelEntity
com.codename1.gaming.platformer.BlockEntity
com.codename1.gaming.platformer.Gate
A gate wired to a channel: open while the channel is on (or off, when
inverted). Switches turn channels on and off.-
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.voidonAdded(PlatformWorld world) Called once when the entity is added to a world, before the first step: the place to write solid cells.voidstep(PlatformWorld world) Advances one tick.Methods inherited from class BlockEntity
getTouchMargin, hashState, isSolid, setSolidMethods inherited from class LevelEntity
deactivate, getId, getType, isActive, onTouch
-
Constructor Details
-
Gate
Creates a gate.
Parameters
id: the idx: left, fixed point, on a tile edgey: top, fixed point, on a tile edgew: width, whole tiles, fixed pointh: height, whole tiles, fixed pointchannel: the channel, 0 to 31inverted: true to be open while the channel is off
-
-
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
-
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
-
step
Description copied from class:LevelEntityAdvances one tick. The default does nothing.
Parameters
world: the world
- Overrides:
stepin classLevelEntity
-