Ok, so, obviously, i am new and need help. I want to know how i can make an actor, like "Apple", pop up on screen for 5, then disappear. apple can be eaten, the world is Grassy, and i am pleading for answers. suggestions?
It would be something like this. Up at the start of your class you'd have a line like:
int count =0;
then inside your act() method, just say something like
count++;
if(count == 300)
{
World myWorld = getWorld();
myWorld.removeObject(this);
}
Play around with the 300 to get it to stay the right amount of time.
There are better and more sophisticated ways to do this, but this would be a good simple solution.
It would be something like this. Up at the start of your class you'd have a line like:
int count =0;
then inside your act() method, just say something like
count++;
if(count == 300)
{
World myWorld = getWorld();
myWorld.removeObject(this);
}
Play around with the 300 to get it to stay the right amount of time.
There are better and more sophisticated ways to do this, but this would be a good simple solution.
ohmy----. thank you SOOOOOOO much! I finally figured this out using this. THANKYOUTHANKYOUTHANKYOUTHANKYOU!!!!!