PDA

View Full Version : need help with making somehting happen in only certain circumstances


aRB
10-08-2008, 06:37 PM
hi,
ok so i need to know how to make a fish fly up to the camera, but only when the boat is infront of it and i push the button "f"
i have already tried messing around with the "If/else" stuff and logical functions but i just cant seem to get it right
right now i have
If:both "Fishboat" is behind "ugly fish" and "world.event5" != "world.event5
do "fish camera""

"world.event5" is just an event i made up in the events box that says when f is typed make boat shake a little basically, and "fish camera" is when the fish would fly to the camera

this forum seems to be dead but any help would be appreciated

Scott
10-08-2008, 09:16 PM
Hmmm...

Right now in school we are going over the "if/else" stuff. in the top right box of Alice there is a section called "Events". It already has a thing for when the world starts. Press the "Create New Event" button and choose "When A Key Is Typed" click on the red letters "Any Key" and Select "Letter" an then find "F".

Down at the bottom bar, grab and drag the "If/Else" and drag it into the red lettering in the same bar in the events and put where it says "Nothing" then select true.

Then go to the fish in the top left box with the objects and then to the right of methods, select "Functions". Then select "Is Behind" from he category "Spacial Relation" and drag that into the box of the if/else that says "True" it should outline in yellow. Drop it and choose the boat for the next option. then set whatever distance you want.

Then go to the Methods tab for the fish and choose the "Move to" Method and drag and drop that in the first part of the if else where it should say "Do Nothing" and set it to go towards the camera.

Now if have the fish go behind the boat, the fish will come towards the camera. And remember that all of this is being done in the Events box.

If you need any more help or further questions, just ask :)