Module project.pong

Class BallView

java.lang.Object
project.pong.view.component.BallView

public class BallView extends Object
The BallView class represents the graphical view of the ball in the Pong game.
  • Constructor Details

    • BallView

      public BallView(Object ball)
      Constructs a BallView object with the specified ball.
      Parameters:
      ball - The ball model object.
  • Method Details

    • getBallView

      public javafx.scene.shape.Circle getBallView()
      Gets the graphical representation of the ball.
      Returns:
      The Circle object representing the ball view.
    • getBallPosition

      public ArrayList<Integer> getBallPosition()
      Gets the current position of the ball.
      Returns:
      An ArrayList containing the x and y coordinates of the ball.
    • updatePosition

      public void updatePosition()
      Updates the position of the ball view based on the ball model.
    • toString

      public String toString()
      Overrides:
      toString in class Object