Is it possible to code the wombat to have a set number of leafs it can eat, like having a set number of two leafs it can eat, move to the next leaf, not eat it, and move on like normally?
/** * Eat a leaf (if there is one in our cell). */ public void eatLeaf() { Actor leaf = getOneObjectAtOffset(0, 0, Leaf.class); if (leaf != null) { // eat the leaf... getWorld().removeObject(leaf); leavesEaten = leavesEaten + 1; } }