public boolean collisionCheck(Door d) { if (rect.intersects(d.rect)) { try { MakeSound.playSound("Sounds/Hit_Wall.wav"); } catch (Exception ex) { ex.printStackTrace(); } return true; } else { return false; } }
public Bullet(double x, double y, double heading, int speed) { this.x = x; this.y = y; this.heading = heading; this.speed = speed; rect = new Rectangle((int) x, (int) y, 2, 2); bullet = Toolkit.getDefaultToolkit().createImage("Images/Bullet.png"); try { MakeSound.playSound("Sounds/Gun_Silencer.wav"); } catch (Exception ex) { ex.printStackTrace(); } }
@Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub MakeSound play = new MakeSound(); play.playSound("0a0.wav"); }