Class Feedback.Reaction

java.lang.Object
com.codename1.gaming.platformer.view.Feedback.Reaction
Enclosing class:
Feedback

public static final class Feedback.Reaction extends Object
What one kind of event does.
  • Constructor Details

    • Reaction

      public Reaction()
  • Method Details

    • shake

      public Feedback.Reaction shake(double pixels, double seconds)

      Shakes the camera.

      Parameters
      • pixels: the amplitude
      • seconds: the duration
      Returns

      this reaction

    • flash

      public Feedback.Reaction flash(int argb, double seconds)

      Flashes the screen.

      Parameters
      • argb: the color; its alpha is the strongest opacity
      • seconds: the fade time
      Returns

      this reaction

    • sound

      public Feedback.Reaction sound(String name)

      Plays a sound.

      Parameters
      • name: passed to the Sink
      Returns

      this reaction

    • particles

      public Feedback.Reaction particles(int count, int argb)

      Bursts particles.

      Parameters
      • count: how many
      • argb: their color
      Returns

      this reaction

    • playerOnly

      public Feedback.Reaction playerOnly()

      Limits the shake and flash to events about the player, so an enemy landing off screen does not rattle the camera.

      Returns

      this reaction