View Single Post
Old
ekat90
Junior Member
 
Status: Offline
Posts: 6
Join Date: Dec 2012
Location: melb
Default 12-12-2012, 10:18 PM

Quote:
Originally Posted by HaloMike117 View Post
Resolving this problem is quite simple by using an if statement to check if the fish has been eaten or not.

To do this, you'll want to create a boolean that checks if the fish is showing or not.
Code:
boolean fishDead()
{
     if (fish.isShowing == true)
     {
          return true;
     }
     return false;
}
Next, all you'll need to do is check if the fish is dead or not before executing the code where the fish says "yum!".

To do this, simply add the following if statement:
Code:
if (fishDead() == true)
{
     //say("Yum");
}
Simple as that!

Good luck (:
I'm obviously using alice I don't know how too add boolean (fishdead) I just got not a both a and b and either a or b, or both, i dont know how too add =isshowing. we've only been taught to click and drag methods and functions thus far.

The only way i thought you could tell alice its dead is by changing the opacity 0%. Sorry guys I'm a complete newbie I just hope i don't fail this assignment

Quote:
Originally Posted by Beans View Post
REALLY easy thing to do:
Variables!
Make a variable: Fish_Eaten
or something, make it turn on if the
fish is eaten, and then add a infinite loop
of if Fish_Eaten is on do nothing, else do
(insert your code here) when you reach within a certain
spot of the fish.
the assignment restricts us from doing variables
   
Reply With Quote