From d0d0eb69e1de3c5cae6311a718f74ced2919158a Mon Sep 17 00:00:00 2001 From: fdai7382 Date: Fri, 27 Jan 2023 23:19:49 +0100 Subject: [PATCH] refactoring: [MouseGame Class]: Auslagern der X-Variable des Resets. --- .../hs_fulda/gruppenprojekt/JavaGamelauncher/MouseGame.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 8b6d6fd..177b942 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 @@ -20,6 +20,8 @@ public class MouseGame extends JFrame { private JPanel contentPane; public Robot robot = new Robot(); + + int resetX = 200; /** @@ -45,7 +47,7 @@ public class MouseGame extends JFrame { //Fensterrahmen Haupt Layout setTitle("Mouse Game"); setBounds(100, 100, 900, 650); - robot.mouseMove(200, 170); + robot.mouseMove(resetX, 170); contentPane = new JPanel(); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); @@ -127,7 +129,7 @@ public class MouseGame extends JFrame { panel.addMouseListener(new MouseAdapter() { @Override public void mouseEntered(MouseEvent e) { - robot.mouseMove(200, 170); + robot.mouseMove(resetX, 170); } }); }