Alice Community  

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

Reply
 
Thread Tools Display Modes
REAL object collisions?
Old
Aeia
Guest
 
Status:
Posts: n/a
Default REAL object collisions? - 10-18-2007, 03:39 PM

I am trying to design an assignment where students direct an object around one of the hedge mazes, but I have no idea how to make the hedge impenetrable. As long as the proximity functions rely on the object's center and not its skin, how can you determine proximity to the surface of the hedge, so as to deny movement thorugh it?
   
Reply With Quote
Old
TheRaiderNation
Guest
 
Status:
Posts: n/a
Default 10-20-2007, 01:56 AM

Okay, what you may be able to do is create a bunch of dummy objects, and place them along the hedges. And say, for example:

While true----
If "chracter" is within x meters of the dummy object
move character back x amount of meters
else do nothing.

It's a really rough sketch, but basically what it's saying is that, when the character gets to close to the hedge, the program will automatically set them back x amount of meters, thus making it impossible to go through the hedges.

Sorry if thats a little confusing, just tell me if you need any more help.
   
Reply With Quote
first person view
Old
mullins
Guest
 
Status:
Posts: n/a
Default first person view - 10-20-2007, 10:28 AM

The camera is reluctant to move (forward) through the maze wall. If you are persistant, it seems to find cracks to sneak through, especially in corners. So, if the camera assumes first person view and you let the arrow keys control the camera, you will get an approximation of what you want.

Unfortunately, the camera seems quite willing to back up through walls.

Also, this only seems to work when you use the builtin event handler.

On the plus side, it seems to work for all objects.
   
Reply With Quote
forgot to mention
Old
mullins
Guest
 
Status:
Posts: n/a
Default forgot to mention - 10-20-2007, 10:35 AM

You can supplement the builtin event handler with your own.

While the down arrow (back up) is pressed, make the camera move forward. I have used 15m with the abrupt style effectively, but there are interesting effects if you play with these arguments.

The idea is to cancel the default event handler for the down arrow.
   
Reply With Quote
More information on collision detection
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default More information on collision detection - 10-20-2007, 12:03 PM

Go to http://www.alice.org/community/showt...=3955#post3955 and see the comment on collision detection.

Dick Baldwin
Free Alice tutorials: http://www.dickbaldwin.com/tocalice.htm
Free programming tutorials: http://www.dickbaldwin.com/toc.htm
   
Reply With Quote
Old
islandfever
Guest
 
Status:
Posts: n/a
Default 10-20-2007, 12:38 PM

Quote:
Originally Posted by mullins View Post
You can supplement the builtin event handler with your own.

While the down arrow (back up) is pressed, make the camera move forward. I have used 15m with the abrupt style effectively, but there are interesting effects if you play with these arguments.

The idea is to cancel the default event handler for the down arrow.
That sounds quite effectiuve.... I think I should try that too!
   
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.