Alice Community  

Go Back   Alice Community > General Discussion > Questions and Comments

Reply
 
Thread Tools Display Modes
collision detection not working
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default collision detection not working - 12-07-2008, 01:59 AM

I'm pretty sure that this is a problem with the actual Alice program, but I'm wondering if I'm missing anything from this.
Attached Images
File Type: jpg collision.jpg (15.4 KB, 113 views)
   
Reply With Quote
Old
Niteshifter
Guest
 
Status:
Posts: n/a
Default 12-07-2008, 02:08 AM

I see the picture's not working the way I want it to, so I'll just type out the code:

Code:
Events:
When the world starts, do world.main
Let the arrow keys move cube

Methods:

world.main
No parameters
No variables

world.collision source=cube target=sphere

world.collision
Object parameter: source
Object parameter: target
No variables

Loop infinity times times
If world.colDet source=source target=target == true
source move amount=0.1 meters away from target=target duration=0 style=abruptly
Else Do Nothing

Functions:

Boolean Function
world.colDet
Object parameter source
Object parameter target
Boolean variable det = false

If source is within 0.1 meters of target
det set value to true
Else
det set value to false
Return det
   
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 ©2019, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.