I created a game where, after its starts, the bug eats the leaf. But I want to add a new leaf after one has been eaten, in another random place. I tried the addObject function, but it didn't work.
I created a game where, after its starts, the bug eats the leaf. But I want to add a new leaf after one has been eaten, in another random place. I tried the addObject function, but it didn't work.
There are a couple (at least) ways to accomplish that. You could use an act method in your world class to maintain a certain number of leaves in the world. Or, you could just move the leafs to new random locations when "eaten".