Class LookAbility

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

public class LookAbility extends Ability
Looking up and down: holding up, or down, while standing still for delayTicks sets a look direction that a camera pans by (see getLook()).
  • Field Details

    • delayTicks

      public int delayTicks
      Ticks of holding before the camera pans.
  • Constructor Details

    • LookAbility

      public LookAbility()
  • 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
    • getLook

      public int getLook()

      The look direction: -1 up, 1 down, 0 neither.

      Returns

      the direction

    • hashState

      public long hashState(long h)
      Description copied from class: Ability

      Mixes the ability's own state into a hash, so two runs that diverge inside an ability are caught. The default mixes nothing.

      Parameters
      • h: the running hash
      Returns

      the updated hash

      Overrides:
      hashState in class Ability
    • reset

      public void reset()
      Description copied from class: Ability
      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. The default does nothing; an ability with per-run state overrides it.
      Overrides:
      reset in class Ability