1 2 3 4 5 6 | if (Greenfoot.mouseClicked(! null )) { Bullet Bullet = new Bullet(); getWorld().addObject(Bullet, getX(), getY()); Bullet.setRotation(getRotation()); } |
1 2 3 4 5 6 | if (Greenfoot.mouseClicked(getWorld()) || Greenfoot.mouseClicked(Rock. class )) { Bullet Bullet = new Bullet(); getWorld().addObject(Bullet, getX(), getY()); Bullet.setRotation(getRotation()); } |