Alice Community

Alice Community (
-   How do I...? (
-   -   Making a collision? (

GameKid 05-16-2011 09:24 PM

Making a collision?
Sorry if this sounds noobish.
I've seen lots of worlds with a collision code/method, but how do i create that? Is it a string? If yes, what's the coding for the string?

TauTrumpsPi 05-16-2011 10:02 PM

It's actually very complicated. The best one I've seen is here: [url][/url]

sfunk 05-16-2011 11:31 PM

well depending on the type of collision you want, it can be difficult, or even more difficult lol but if you are doing a very simple collision, you might be able to squeak by using just a simple if whatever is so far away from whatever, move however far away

GameKid 05-26-2011 09:04 PM

Sfunk, I know that, what i'm asking is; how?
Thanks tau, i'll try to use that, if all else fails.

TauTrumpsPi 05-26-2011 09:37 PM

[QUOTE=GameKid;36496]Sfunk, I know that, what i'm asking is; how?
Thanks tau, i'll try to use that, if all else fails.[/QUOTE]

Make a sphere and infinitely loop:

If (Thing to collide) is within (Sphere's width/2) of Sphere
(Thing to collide) move (Opposite direction in which it is currently traveling, use a variable that changes with you're movement command) (Exact speed at which the thing to collide is currently traveling)
Do nothing

Just play that method with a parameter for the sphere and play the method infinitely for each sphere you have, and each thing you want to collide with it you have. Put the spheres, invisible, anywhere you want a collision to be, using many spheres placed correctly to make a different shape.

GameKid 05-30-2011 04:19 PM

I don't get it, which are the strings and which are the pre-listed? Can you post a screen shot?

GameKid 06-13-2011 11:20 PM

Bump. Please help, guys.

All times are GMT -5. The time now is 01:20 AM.

Copyright ©2018, Carnegie Mellon University
Alice 2.x 1999-2012, Alice 3.x 2008-2012, Carnegie Mellon University. All rights reserved.