When I click my mouse the cannon shoots twice. Once for when the mouse is held down and once when it is released. I do not see anything in the API for only going down. I haven't set a delay for the cannon yet so it still fires automatically as well when the mouse is moving.
public void shoot()
{
MouseInfo mouse = Greenfoot.getMouseInfo();
if(alive_ && mouse!=null)
{
if(mouse.getButton() == 1)
{
BlueBullet bullet = new BlueBullet();
bullet.setRotation(getRotation());
getWorld().addObject(bullet, getX(), getY());
}
}
}
