Hey guys! Needed to know how to detect if there is an arrow, or in this case, "Ranged", in the world. Also could use a little advice on how to clean this code up. Thanks!
public void rangedAttack()
{
if (Greenfoot.isKeyDown("o"))
{
if (Main_World.playerStamina != (0))
{
if (Main_World.playerStamina != (1))
{
if (Main_World.playerStamina != (2))
{
if (Main_World.playerStamina != (3))
{
if (Main_World.playerStamina != (4))
{
Ranged attack = new Ranged();
getWorld().addObject(attack, getX(), getY());
}
}
}
}
}
}
}

