java.lang.Object
project.pong.model.RacketMovementHandler
- All Implemented Interfaces:
Runnable
The RacketMovementHandler class manages the movement of rackets in the Pong game.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a RacketMovementHandler object with the specified GamePong instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidhandleKeyPressed(javafx.scene.input.KeyEvent event) Handles the key pressed event for racket movement.voidhandleKeyReleased(javafx.scene.input.KeyEvent event) Handles the key released event for racket movement.voidrun()Continuously runs the racket movement logic.
-
Constructor Details
-
RacketMovementHandler
Constructs a RacketMovementHandler object with the specified GamePong instance.- Parameters:
pong- The GamePong instance to handle racket movement for.
-
-
Method Details
-
run
public void run()Continuously runs the racket movement logic. -
handleKeyPressed
public void handleKeyPressed(javafx.scene.input.KeyEvent event) Handles the key pressed event for racket movement.- Parameters:
event- The KeyEvent representing the key pressed event.
-
handleKeyReleased
public void handleKeyReleased(javafx.scene.input.KeyEvent event) Handles the key released event for racket movement.- Parameters:
event- The KeyEvent representing the key released event.
-