From 65ef4b0991aee3b45fa8b609e2da5702756c8af2 Mon Sep 17 00:00:00 2001 From: Amir Daouadi Date: Wed, 12 Apr 2023 00:20:02 +0200 Subject: [PATCH] erreur --- HGameController.java | 33 --------------------------------- Player.java | 23 ----------------------- 2 files changed, 56 deletions(-) delete mode 100644 HGameController.java delete mode 100644 Player.java diff --git a/HGameController.java b/HGameController.java deleted file mode 100644 index dd2733f..0000000 --- a/HGameController.java +++ /dev/null @@ -1,33 +0,0 @@ -package Controller; -import java.awt.event.KeyEvent; -import java.awt.event.KeyListener; - -public class HGameController implements KeyListener { - private Player player; - - public HGameController(Player player) { - this.player = player; - } - - @Override - public void keyPressed(KeyEvent e) { - int keyCode = e.getKeyCode(); - if (keyCode == KeyEvent.VK_UP) { - player.move(-1, 0); - } else if (keyCode == KeyEvent.VK_DOWN) { - player.move(1, 0); - } else if (keyCode == KeyEvent.VK_LEFT) { - player.move(0, -1); - } else if (keyCode == KeyEvent.VK_RIGHT) { - player.move(0, 1); - } - } - - @Override - public void keyReleased(KeyEvent e) { - } - - @Override - public void keyTyped(KeyEvent e) { - } -} diff --git a/Player.java b/Player.java deleted file mode 100644 index 3fc280c..0000000 --- a/Player.java +++ /dev/null @@ -1,23 +0,0 @@ -package Controller; -public class Player { - private int x; - private int y; - - public Player(int x, int y) { - this.x = x; - this.y = y; - } - - public void move(int dx, int dy) { - x += dx; - y += dy; - } - - public int getX() { - return x; - } - - public int getY() { - return y; - } -}