Alice Community  

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

Reply
 
Thread Tools Display Modes
collition detection perfection
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Arrow collition detection perfection - 09-03-2008, 04:52 PM

since there are always people asking how to do collision detection i have decided to make the perfect example for you to understand and build on...

the point of the game is simple. move the red box onto the yellow platform by pushing it with the blue box...

simple, yet would probably help some of you...

if you want to add vertical collision detection, simply add a (IF above and IF below in the IF statement in MY FIRST METHOD)

rick
Attached Files
File Type: a2w collition detection perfection.a2w (225.0 KB, 306 views)


im back!!! FINNALY!!! got windows working on my mac again!!!

Last edited by rich0e0rick; 09-03-2008 at 04:57 PM.
   
Reply With Quote
Tank you
Old
Mega Mike
Guest
 
Status:
Posts: n/a
Talking Tank you - 09-04-2008, 05:27 AM

Ok that was very good, I finaly anderstand how do I do an colision, Thank you
   
Reply With Quote
Old
Mega Mike
Guest
 
Status:
Posts: n/a
Default 09-04-2008, 07:01 AM

Men I have done exatly like you, and that don't work! The onli thing is not equal is onli one object move away from the outher, men I quick, I will make the game, and them I will be worried whit this!!!!
   
Reply With Quote
post
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Lightbulb post - 09-04-2008, 09:35 AM

try posting your world, its probably something small you mist...


im back!!! FINNALY!!! got windows working on my mac again!!!
   
Reply With Quote
made some small changes
Old
Digimath
Guest
 
Status:
Posts: n/a
Default made some small changes - 09-04-2008, 06:12 PM

Rich0e0rick,

Thanks for sharing your program/tutorial. I like the way itís easy to understand.

I did a little study with different objects and noticed two things. The collisions worked better when both the blue block and the pushed object had the same orientation and the shorter of the two objects would tend to be pushed into the ground. I added some steps to align the orientation and move the objects back to ground level after each collision.
Attached Files
File Type: a2w collisionV2.a2w (277.9 KB, 103 views)
   
Reply With Quote
Old
Mega Mike
Guest
 
Status:
Posts: n/a
Default 09-05-2008, 06:17 AM

I will finish my game, them I will put it into the forum, and see what I am doing wrong
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 09-05-2008, 07:06 AM

One other note - the smoothness of the program is very dependent on the distance the objects move during each incremental step. (This is the "correct" behaviour for the code, but could be confusing to a beginner.)

The attached lets you input a new value for the step size each time the program is run. Above about 1 meter, things start to get really hard. Might be bad if it wasn't expected or good if you wanted to make the game get harder the longer it was played.
Attached Files
File Type: a2w collision detection imperfection.a2w (219.1 KB, 76 views)
   
Reply With Quote
ok
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Arrow ok - 09-05-2008, 10:36 PM

yes but your way makes the users want to put round numbers, making it go crazy... you would either have to make it divide the number given, or ask the user to put 0. decimals...

rick


im back!!! FINNALY!!! got windows working on my mac again!!!
   
Reply With Quote
also
Old
rich0e0rick
Senior Member
 
rich0e0rick's Avatar
 
Status: Offline
Posts: 141
Join Date: Jan 2008
Location: Sturgeon Falls
Default also - 09-05-2008, 10:40 PM

i might also make it so that you have acceleration, therefore making it bounce at a similar speed...

rick


im back!!! FINNALY!!! got windows working on my mac again!!!
   
Reply With Quote
Um..
Old
Buddy_ca111
Guest
 
Status:
Posts: n/a
Question Um.. - 09-07-2008, 12:41 AM

Is there a way to make the player stop move and the other object not move? Thx
   
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 ©2020, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.