Class SwimAbility
java.lang.Object
com.codename1.gaming.platformer.Ability
com.codename1.gaming.platformer.SwimAbility
Swimming in
Tile#WATER: weak gravity, a slow sink, and a stroke upward on each
jump press. Leaving the water at the surface with a stroke gives a small hop out.-
Field Summary
FieldsModifier and TypeFieldDescriptionintFastest sink.intHorizontal speed limit in water.intUpward speed of a stroke.intGravity in water, fixed point per tick squared. -
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 in water.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, lateProcess, mix, setEnabled
-
Field Details
-
waterGravity
public int waterGravityGravity in water, fixed point per tick squared. -
maxSink
public int maxSinkFastest sink. -
stroke
public int strokeUpward speed of a stroke. -
maxSwimSpeed
public int maxSwimSpeedHorizontal speed limit in water.
-
-
Constructor Details
-
SwimAbility
public SwimAbility()
-
-
Method Details