Alice Community  

Go Back   Alice Community > Alice 3 > How Do I?

Reply
 
Thread Tools Display Modes
collision detection in Alice 3.0
Old
joethechicken
Junior Member
 
Status: Offline
Posts: 9
Join Date: Feb 2012
Location: in a pineapple under the sea
Default collision detection in Alice 3.0 - 02-12-2012, 09:46 PM

Hi, has anyone here tried doing collision detection in the 3.0 beta? I am creating a maze game and every time I try to add some sort of collision detection to the code, there is either major lag or an error report or both.
Help will be greatly appreciated.


My current code involves getting the distance between the character that is being controlled and a wall.
Then, "if statement" the distance is greater than 0, the character can be turned left and right, and it can be moved forwards, using the arrow keys ("do together").
Each time, it moves, it gets the distance between the wall and the character.
"Else part of if statement" the character moves backwards the same distance that it had just moved forwards and says "I can't walk through walls."
However, after I run the program, each time the character moves, there is an error message.
When I tried looping the if statement, the same thing happened and the character became a lot more difficult to control.
   
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 ©2017, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.