diff --git a/out/production/final/GamePanel.class b/out/production/final/GamePanel.class index c4d26fa..d1e428a 100644 Binary files a/out/production/final/GamePanel.class and b/out/production/final/GamePanel.class differ diff --git a/out/production/final/GenericSprite.class b/out/production/final/GenericSprite.class index 859f6df..1a84cc0 100644 Binary files a/out/production/final/GenericSprite.class and b/out/production/final/GenericSprite.class differ diff --git a/src/GamePanel.java b/src/GamePanel.java index fb75c80..77930d3 100644 --- a/src/GamePanel.java +++ b/src/GamePanel.java @@ -48,9 +48,7 @@ public class GamePanel extends JPanel implements Runnable, KeyListener{ e.printStackTrace(); } } - player = new Player(GAME_WIDTH/2, GAME_HEIGHT/2, 'W', 'A', 'S', 'D', spriteArray); //create a player controlled player, set start location to middle of screen - map.add(new Tile(1000, 700)); - map.add(new Tile(700, 600)); + player = new Player(GAME_WIDTH/2, GAME_HEIGHT/2, 'W', 'A', 'S', 'D', spriteArray); //create a player controlled player, set start location to middle of screenk map.add(new Tile(1000, 500)); map.add(new Tile(700, 400)); map.add(new Tile(1000, 300)); diff --git a/src/GenericSprite.java b/src/GenericSprite.java index 00c2b4b..abffe35 100644 --- a/src/GenericSprite.java +++ b/src/GenericSprite.java @@ -31,20 +31,21 @@ public class GenericSprite extends Rectangle{ public void keyPressed(KeyEvent e){ if(e.getKeyChar() == 'd'){ rightPressed = true; - move(); + } if(e.getKeyChar() == 'a'){ leftPressed = true; - move(); + } if(e.getKeyChar() == 'w'){ upPressed = true; - move(); + } if(e.getKeyChar() == 's'){ downPressed = true; - move(); + } + move(); } //called from GamePanel when any key is released (no longer being pressed down) diff --git a/src/MenuPanel.java b/src/MenuPanel.java index 72b0a64..423b54a 100644 --- a/src/MenuPanel.java +++ b/src/MenuPanel.java @@ -14,7 +14,7 @@ public class MenuPanel extends JFrame implements ActionListener { this.setTitle("First"); this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); this.setSize(280, 200); - this.setVisible(true); + launchGame = new JButton("Click"); launchGame.addActionListener(this); @@ -22,6 +22,7 @@ public class MenuPanel extends JFrame implements ActionListener { menuContainer = getContentPane(); menuContainer.setLayout(new FlowLayout()); menuContainer.add(launchGame); + this.setVisible(true); } public void paint(Graphics g) {