Alice Community

Alice Community (http://www.alice.org/community/index.php)
-   How do I...? (http://www.alice.org/community/forumdisplay.php?f=16)
-   -   Object Variables (is there a way?) (http://www.alice.org/community/showthread.php?t=6158)

Matchewawa 03-21-2011 06:01 PM

Object Variables (is there a way?)
 
I'm setting up collision on a level, but it is extremely tedious and time consuming. I know there is a way to make an object variable that represents a list of objects, but when I put it into a function, it doesn't allow me to use all of the objects in the list at once. What I'm trying to do is basically 'if you hit this object, (or in this case, any of THESE objects) you move back.'

reuben2011 03-21-2011 06:08 PM

Have you tried using the "for all together" statement?

Matchewawa 03-21-2011 06:20 PM

How?
 
1 Attachment(s)
How would I use a for all together in this situation. (the highlighted
area is where the list of objects would go)
[ATTACH]4375[/ATTACH]

debussybunny563 03-21-2011 08:23 PM

1 Attachment(s)
[SIZE="2"]First, define a list, and put all the objects you want collision to be possible with in that list (the <none>s in your screenshot). (1.)

Then, use the For All Together statement like in the screenshot. (2.)[/SIZE]

Matchewawa 03-22-2011 03:31 PM

Thanks
 
Awesome AWESOME, THANKS! That'll help sooo much!!!

debussybunny563 03-22-2011 04:12 PM

[SIZE="2"]No problem. And to see a great example of collision detection in Alice at work, look at [URL="http://www.alice.org/community/showthread.php?t=4301&highlight=maze"][SIZE="2"]Dameria's Maze Game.[/SIZE][/URL]

You might want to ask Dameria about the coding. He's kind of the unofficial expert on collisions. ;)

Collision detection in Alice is really not as easy as it may seem.[/SIZE]

reuben2011 03-22-2011 06:23 PM

[QUOTE=debussybunny563;32600][SIZE="2"]
Collision detection in Alice is really not as easy as it may seem.[/SIZE][/QUOTE]

Very true. Especially if you want to have a "good" collision detection system.


All times are GMT -5. The time now is 08:41 PM.

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