If you make a vairable named apple, then colecting the apple should have a code like:
- Code: Select all
apple+=1; // add one apple
And most likely touching the apple will result in destroying the apple actor.
So now if you want to use the apple, a code such as:
- Code: Select all
if (apple>=1) // if you have more than one
{
apple-=1; //takes away one
// Your special code for throwing the apple.
}
Renember the actor apple should have a diffrent name to the vairable, eg: Actor, Apple - Vairable, apple (Cap first letter)
I hope this helps.
(Please reply back to let me know if this helps!
)