Class LadderAbility
java.lang.Object
com.codename1.gaming.platformer.Ability
com.codename1.gaming.platformer.LadderAbility
Climbing Tile#LADDER cells. Up or down while overlapping a ladder grabs it:
gravity stops, the actor centres on the ladder and moves at climbSpeed.
Jumping lets go (JumpAbility treats a ladder as ground), as does climbing off
either end. Standing on top of a ladder and holding down climbs down through it.
Add it before JumpAbility so a jump from the ladder sees the climbing state.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonghashState(long h) Mixes the ability's own state into a hash, so two runs that diverge inside an ability are caught.booleanWhether the actor is on a ladder.voidlateProcess(Actor c, PlatformWorld world) Runs after the body moved, with the new contacts.voidprocess(Actor c, PlatformWorld world) Sets velocity and claims aMovementState.voidreset()Forgets what the ability was in the middle of, when its actor respawns: a dash, a buffered jump or a grip does not outlive a death.Methods inherited from class Ability
earlyProcess, isEnabled, mix, setEnabled
-
Field Details
-
climbSpeed
public int climbSpeedClimbing speed, fixed point per tick.
-
-
Constructor Details
-
LadderAbility
public LadderAbility()
-
-
Method Details
-
process
Description copied from class:AbilitySets velocity and claims a
MovementState.Parameters
c: the actorworld: the world
-
lateProcess
Description copied from class:AbilityRuns after the body moved, with the new contacts.
Parameters
c: the actorworld: the world
- Overrides:
lateProcessin classAbility
-
isClimbing
public boolean isClimbing()Whether the actor is on a ladder.
Returns
true while climbing
-
hashState
-
reset
-