From 3d203a3e64d533eaeca1d5cdd3aa65032fdec3fa Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Fri, 27 Jan 2023 23:31:14 +0100 Subject: [PATCH] refactoring: [MouseGame Class]: Auslagern der Y-Variable des Resets. --- .../gruppenprojekt/JavaGamelauncher/MouseGame.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java index 83ad7f3..565279a 100644 --- a/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java +++ b/JavaGamelauncher/src/main/java/de/hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java @@ -22,7 +22,8 @@ public class MouseGame extends JFrame { public Robot robot = new Robot(); int resetX = 200; - + int resetY = 170; + /** * Launch the application. @@ -47,7 +48,7 @@ public class MouseGame extends JFrame { //Fensterrahmen Haupt Layout setTitle("Mouse Game"); setBounds(100, 100, 900, 650); - robot.mouseMove(resetX, 170); + robot.mouseMove(resetX, resetY); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); @@ -134,7 +135,7 @@ public class MouseGame extends JFrame { panel.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { - robot.mouseMove(resetX, 170); + robot.mouseMove(resetX, resetY); } }); }