Changed map

master
bob 2022-06-01 14:49:35 -04:00
parent f6fe5def83
commit 77e85f72f4
5 changed files with 8 additions and 8 deletions

Binary file not shown.

View File

@ -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));

View File

@ -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)

View File

@ -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) {