i want my instructions for my game to disappear either when a point is scored or after 3 seconds but not sure what the code is please help
//Instruction class
private int time = 180; //approx. 3 seconds with speed slider in the middle
public void act()
{
time--;
if (time==0)
{
removeObject(this);
}
}//actor which scores
if (/*touching item*/)
{
//collect item
//add score
Actor i = (Actor) getWorld().getObjects(Instruction.class).get(0);
if (i != null) getWorld().removeObject(i);
}getWorld().removeObject(this);