I tried moving the counter to the character "lime" but once again I dont know how to make every chest only raise the count once so I currently have both counters going on and they both dont work like Id like them to. Lime= and the chest
private void findChest()
{
if ( canSee(Chest.class) )
{
find(Chest.class);
counter = counter + 1;
System.out.println(counter);
Greenfoot.delay(5);
if (counter == 8)
{
Greenfoot.stop();
}
}
}
public boolean canSee(Class clss)
{
Actor actor = getOneObjectAtOffset(0, 0, clss);
return actor != null;
}
public void find(Class clss)
{
Actor actor = getOneObjectAtOffset(0, 0, clss);
}
}
public void checkOpen()
{
ppen = getOneObjectAtOffset(0,0, Lime.class);
if (ppen != null)
{
if (isSpecial() && getImage() != image2)
{
setImage(image2);
Greenfoot.playSound("ZeldaChest.wav");
Greenfoot.stop();
}
if (!isSpecial() && getImage() != image1)
{
setImage(image1);
counter = counter + 1;
Greenfoot.delay(5);
counter += fails;
if (counter == 10) Greenfoot.stop();
}
}
}
}
