Class DashAbility
java.lang.Object
com.codename1.gaming.platformer.Ability
com.codename1.gaming.platformer.DashAbility
A horizontal dash on
Input#DASH: dashTicks at dashSpeed in the facing
direction with gravity off, then a cooldownTicks wait. In the air it can be
used airDashes times before landing.-
Field Summary
FieldsModifier and TypeFieldDescriptionintDashes allowed per jump.intTicks before the next dash.intDash speed, fixed point per tick.intDash length in ticks. -
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 a dash is under way.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
-
dashSpeed
public int dashSpeedDash speed, fixed point per tick. -
dashTicks
public int dashTicksDash length in ticks. -
cooldownTicks
public int cooldownTicksTicks before the next dash. -
airDashes
public int airDashesDashes allowed per jump.
-
-
Constructor Details
-
DashAbility
public DashAbility()
-
-
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
-
isDashing
public boolean isDashing()Whether a dash is under way.
Returns
true mid dash
-
hashState
-
reset
-