Alice Community  

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

Reply
 
Thread Tools Display Modes
Wall Collision
Old
MunnyMike
Guest
 
Status:
Posts: n/a
Default Wall Collision - 05-09-2010, 09:34 PM

How do stop models from passing through squares (squares being walls)
I'm using Alice 2.0

I have tried using a if/else
if "model" is within .1 meters of square "x"
"model" move backwards "0.5 meters"
and that doesn't work

I have also tried using functions such as
If "model" distance in front of "square x" <= 0.5 meters
"model" turns right (as seen by "square x")

Niether works for too long
I put both in infinite loops but that doesn't help much either.
The model im trying to keep contained moves in a random pattern.

EDIT
I've used the search function, tried many different ways. One did manage to prevent the model from ever going through, but the second it touched the wall it would stop moving.

Last edited by MunnyMike; 05-09-2010 at 10:23 PM.
   
Reply With Quote
Old
Dameria
Senior Member
 
Dameria's Avatar
 
Status: Offline
Posts: 976
Join Date: Sep 2009
Location: United States
Default 05-10-2010, 07:29 AM

I made an example of a maze using multiple wall collisions, it is in the maze game in my signiature, or just click the link here:

http://www.alice.org/community/showthread.php?t=4301


Check out my best projects so far and please comment:

Tic-Tac-Toe 2.0 ................... http://www.alice.org/community/showthread.php?t=3548
Alice Paint ........................... http://www.alice.org/community/showthread.php?p=23408
Real-Time Clock .................. http://www.alice.org/community/showthread.php?p=12725
Maze Game ......................... http://www.alice.org/community/showthread.php?t=4301
   
Reply With Quote
Reply

Tags
collision, model, stuff, wall

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.