Alice Community  

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

Reply
 
Thread Tools Display Modes
Setting boundaries for moving objects?
Old
BigOrangeArmy
Guest
 
Status:
Posts: n/a
Default Setting boundaries for moving objects? - 10-19-2009, 03:44 PM

So, I'm creating a "game" that has a person moving left to right when "the button is pressed." Problem is, how would you restrict distances you could go? Like not to move past a certain tree so many meters, for instance? Any help would be great, thanks

---BigOrangeArmy
   
Reply With Quote
Old
Nickto1414
Guest
 
Status:
Posts: n/a
Default 10-19-2009, 06:02 PM

ill make an example program and explain that hold on lol

so this is how it works
when the world starts it runs a loop of if statements of
if camera is withing 5 meters of box
then move camera back 10 meters
and it keeps on runing that over and over and over ect. lol
but only 1 bug.
when you backup into it it doesnot work, i dont know howto fix this but when i find out ill post it.

file of example in attachments (: hope this helped
Attached Files
File Type: a2w Wallcolissionexample.a2w (258.9 KB, 37 views)

Last edited by Nickto1414; 10-19-2009 at 06:22 PM.
   
Reply With Quote
Old
Jeremytroid
Guest
 
Status:
Posts: n/a
Default 10-19-2009, 06:03 PM

Put an "if/else" statement then "true" and make (under functions) "[object] is with in threshold of[object]"
then under the "if" and "else" parts put the methods you want the world to do.
   
Reply With Quote
Old
BigOrangeArmy
Guest
 
Status:
Posts: n/a
Default 10-20-2009, 08:28 AM

Quote:
Originally Posted by Nickto1414 View Post
ill make an example program and explain that hold on lol

so this is how it works
when the world starts it runs a loop of if statements of
if camera is withing 5 meters of box
then move camera back 10 meters
and it keeps on runing that over and over and over ect. lol
but only 1 bug.
when you backup into it it doesnot work, i dont know howto fix this but when i find out ill post it.

file of example in attachments (: hope this helped
Yeah, thats happened before to me with the loop . Thanks for the help though.
I think I'll just make the world go black and a "Game Over" message appear after the said object moves past the camera bounds (which I marked with some nice-looking DX7 trees haha.)

The If/Else function sounds like it could work though. But you just might get the loop effect like Nickto1414 said.

Thanks guys, really appreciate it
   
Reply With Quote
Reply

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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.