The player shoots continuously while the mouse is clicked and moving but once I stop moving the mouse the player stops shooting. Is there a way to have the player always shooting while the mouse is clicked?
public void shoot()
{
MouseInfo mouseInfo = Greenfoot.getMouseInfo();
if (mouseInfo != null)
{
if (mouseInfo.getButton() == 1)
{
getWorld().addObject(new Bullet(), getX(), getY());
}
}
}
