Alice Community  

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

Reply
 
Thread Tools Display Modes
How do I get more precise collision detection?
Old
sophist42
Guest
 
Status:
Posts: n/a
Unhappy How do I get more precise collision detection? - 05-19-2011, 08:08 AM

Hello Alice gods and goddesses! One of my students is having a strange problem that defies conventional explanation. She is trying to create a game where the screen is surrounded by walls and the user dies if he bumps into any of those walls. She did this by creating a list of Cube objects for each wall and then using a "For all together" loop to check proximity for each list.

The strange thing is, the program registers the event as long as the collision distance is sufficiently large (around 1.25). But then it looks kind of bad -- the event happens before the actual collision. If the distance is reduced, then the collision does not happen any more -- the user just passes through the cube.

Can someone please take a look at the attached program and tell me why collision detection doesn't work if the distance is decreased?

Many thanks!
Roger Wistar
Attached Files
File Type: a2w Snake.a2w (2.06 MB, 2 views)
   
Reply With Quote
It's all about proximity
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default It's all about proximity - 05-19-2011, 05:50 PM

The measurement is based on your characters proximity to the "center point" of the three axes of each of your cubes. If the cubes are too large, the corners are far enougn away from the center to make them passable.
   
Reply With Quote
Problem = lack of perspective
Old
sophist42
Guest
 
Status:
Posts: n/a
Default Problem = lack of perspective - 05-19-2011, 07:29 PM

Quote:
Originally Posted by MrMoke View Post
The measurement is based on your characters proximity to the "center point" of the three axes of each of your cubes. If the cubes are too large, the corners are far enougn away from the center to make them passable.
That seemed to be the problem -- darn that 3D perspective!
   
Reply With Quote
Old
x2495iiii
Super Moderator
 
x2495iiii's Avatar
 
Status: Offline
Posts: 3,508
Join Date: Dec 2008
Location: Somewhere in the Continental U.S.
Default 05-19-2011, 07:40 PM

Make each of the cubes squares and change the proximity to the camera's distance in front of each square. Just makes sure all of the squares are facing inward.
   
Reply With Quote
The X-man is correct
Old
MrMoke
Senior Member
 
MrMoke's Avatar
 
Status: Offline
Posts: 501
Join Date: Sep 2007
Location: Austin, Texas
Default The X-man is correct - 05-19-2011, 09:49 PM

However, there are a few issues that you will still have to deal with. the attached World demonstrates a couple of them. Nuthin wirth doin is evr eezzy. Oops, There goes my spelling again
Attached Files
File Type: a2w Collision with front of Square.a2w (658.3 KB, 11 views)

Last edited by MrMoke; 05-20-2011 at 07:51 AM.
   
Reply With Quote
Reply


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.