Class PowerUp

java.lang.Object
uno.anahata.asi.swing.games.PowerUp

class PowerUp extends Object
Represents a power-up falling item.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) double
    Vertical falling speed.
    (package private) int
    Power-up type (0: Multiball, 1: Wide Paddle, 2: Fireball).
    (package private) double
    Center X-coordinate of the item.
    (package private) double
    Center Y-coordinate of the item.
  • Constructor Summary

    Constructors
    Constructor
    Description
    PowerUp(double x, double y, int type)
    Constructs a PowerUp item.
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) void
    Advances the power-up falling position.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • x

      double x
      Center X-coordinate of the item.
    • y

      double y
      Center Y-coordinate of the item.
    • speedY

      double speedY
      Vertical falling speed.
    • type

      int type
      Power-up type (0: Multiball, 1: Wide Paddle, 2: Fireball).
  • Constructor Details

    • PowerUp

      PowerUp(double x, double y, int type)
      Constructs a PowerUp item.
      Parameters:
      x - Starting X.
      y - Starting Y.
      type - Power Type index.
  • Method Details

    • update

      void update()
      Advances the power-up falling position.