Bomb Physics
parent
c63246cdb9
commit
0aa3cff3e8
|
@ -56,7 +56,7 @@ public class MenuPanel extends JPanel implements Runnable, KeyListener{
|
|||
//add the MousePressed method from the MouseAdapter - by doing this we can listen for mouse input. We do this differently from the KeyListener because MouseAdapter has SEVEN mandatory methods - we only need one of them, and we don't want to make 6 empty methods
|
||||
addMouseListener(new MouseAdapter() {
|
||||
public void mousePressed(MouseEvent e) {
|
||||
player.mousePressed(e);
|
||||
//player.mousePressed(e);
|
||||
}
|
||||
});
|
||||
this.setPreferredSize(new Dimension(GAME_WIDTH, GAME_HEIGHT));
|
||||
|
|
|
@ -74,7 +74,7 @@ public class StickyBomb extends GenericSprite{
|
|||
public void mousePressed(MouseEvent e){
|
||||
int xx = e.getX();
|
||||
int yy = e.getY();
|
||||
GamePanel.b = new StickyBomb(GamePanel.player.x+GamePanel.camera.x,GamePanel.player.y,35, (xx-GamePanel.player.x-GamePanel.camera.x)/20, (yy-GamePanel.player.y)/10, sprite);
|
||||
GamePanel.b = new StickyBomb(GamePanel.player.x+GamePanel.camera.x,GamePanel.player.y,35, (xx-GamePanel.player.x)/20, (yy-GamePanel.player.y)/10, sprite);
|
||||
}
|
||||
|
||||
public void draw(Graphics g){
|
||||
|
|
Loading…
Reference in New Issue