Class MoveAbility

java.lang.Object
com.codename1.gaming.platformer.Ability
com.codename1.gaming.platformer.MoveAbility

public class MoveAbility extends Ability
Horizontal movement: walking, running while Input#RUN is held, crawling while crouched, with separate acceleration on the ground and in the air.
  • Field Details

    • walkSpeed

      public int walkSpeed
      Walking speed, fixed point per tick.
    • runSpeed

      public int runSpeed
      Running speed, fixed point per tick.
    • crawlSpeed

      public int crawlSpeed
      Speed while crouched.
    • groundAcceleration

      public int groundAcceleration
      Change of speed per tick on the ground.
    • groundDeceleration

      public int groundDeceleration
      Change of speed per tick on the ground with no input, the friction.
    • airAcceleration

      public int airAcceleration
      Change of speed per tick in the air.
    • canRun

      public boolean canRun
      Whether Input#RUN is honoured.
  • Constructor Details

    • MoveAbility

      public MoveAbility()
  • Method Details

    • process

      public void process(Actor c, PlatformWorld world)
      Description copied from class: Ability

      Sets velocity and claims a MovementState.

      Parameters
      • c: the actor
      • world: the world
      Specified by:
      process in class Ability