How do you make an if statement to detect if your actor has eaten 3 things? I'll give an example in psuedocode
if dog eats 3 treats
{
the dog dances
}
how do i translate that????
How do you make an if statement to detect if your actor has eaten 3 things? I'll give an example in psuedocode
<< Psuedocode Omitted >>
how do i translate that????
First, you need a field to count the number of treats eaten, call it treatsEaten, and a method to make the dog dance, call it dance. Then, the translation would be: