Alice Community  

Go Back   Alice Community > Alice 2 > How do I...?

Thread Tools Display Modes
Status: Offline
Posts: 17
Join Date: Mar 2009
Default Proximity - 04-21-2009, 03:46 PM

i have a game in the making-process and i have a problem. i need to have:
if <ball> is within <1> metres of <handsomePrince.torso.head>
A method.

But no matter what i do or how hard i try it just won't do the method. i could have the ball inside his head but it won't work. can anyone please help?
Effects Of Depakote

Last edited by g-whizz; 05-14-2011 at 01:23 PM.
Reply With Quote
King Gamer(gorit)
Posts: n/a
Talking Maybe - 04-21-2009, 05:08 PM

post the file and i may be able to help if not i will bother one of the experts lol.
Reply With Quote
Posts: n/a
Default 04-22-2009, 08:44 AM

i have a suggestion. put it in an infinite loop. because if it is just in an if statement it only checks it that one time. wherever it appears in the code. you could also put it in a while statement for the same effect.
Reply With Quote
Senior Member
Chris101b's Avatar
Status: Offline
Posts: 361
Join Date: Jun 2007
Default 04-22-2009, 09:22 AM

I think I know what the problem is. The problem is that you might be putting the if statement in the wrong place. Don't put the if statement in the big main programming box. Look at the top right hand side of the screen where it says events. Click on the button that says "create new event" and then click on the one that says "While something is true".

Now something will appear in that box that says "While <none> is true" and then below it, "Begin", "During", and "End". Now, in the top "While _____ is true is where you will put the "If ball is within 1 meter of head". Now, in the second part, in the "Begin" part, put the method that you want to happen.

What the "Begin", "During", and "End" do is that it tells when to do the method. So if you put the method in the "Begin" part, the method will happen the ball is 1 meter away from his head. If you put it in "during", the method will continue to happen while the ball is within 1 meter of his head. It will not stop. And if you put it in the "End' section, the method will happen when the ball stops being within 1 meter of the head. This means that the ball has to be within 1 meter and then leave the 1 meter area before it works. So for your world, the best thing to do would be to put the method by the "begin" section. Alright I hope this helps.

I am nowhere and everywhere at the same time.
Xbox Live GT: Chris101b
Youtube: (You guessed it)

Last edited by Chris101b; 04-22-2009 at 09:25 AM.
Reply With Quote

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.