Fixed sprite paths

master
Aaron Johnon 1 year ago
parent db5e684b28
commit 6a3f43b435

@ -37,7 +37,7 @@ public class Player extends JPanel implements KeyListener, ActionListener {
private Timer shotTimer; //Player shot timer private Timer shotTimer; //Player shot timer
public Player() { public Player() {
ImageIcon icon = new ImageIcon("spr/tank1.png"); ImageIcon icon = new ImageIcon("src/spr/tank1.png");
sprite = icon.getImage(); sprite = icon.getImage();
setFocusable(true); setFocusable(true);
addKeyListener(this); addKeyListener(this);

@ -12,7 +12,7 @@ public class PlayerBullet {
public PlayerBullet(int startX, int startY) { public PlayerBullet(int startX, int startY) {
this.x = startX; this.x = startX;
this.y = startY; this.y = startY;
ImageIcon icon = new ImageIcon("spr/bullet.png"); ImageIcon icon = new ImageIcon("src/spr/bullet.png");
sprite = icon.getImage(); sprite = icon.getImage();
} }

@ -25,6 +25,8 @@ public class Main {
mainframe.add(playerPanel); mainframe.add(playerPanel);
playerPanel.requestFocusInWindow(); playerPanel.requestFocusInWindow();
mainframe.validate();
mainframe.repaint();
mainframe.setVisible(true); mainframe.setVisible(true);
} }
} }

Loading…
Cancel
Save