Alice Community  

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

Reply
 
Thread Tools Display Modes
Object Variable List Help
Old
nickster654
Senior Member
 
Status: Offline
Posts: 180
Join Date: Feb 2011
Location: nickster12345678@gmail.com
Default Object Variable List Help - 04-17-2011, 07:10 PM

ok so i am making an astroids game, and i have 8 mini astroids, i dont want to make a method for EVERyONE saying if triangle is within one meter of astroid; die, how do i make a object list so that if triangle is within 1 metor of any astroid, die
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-17-2011, 07:55 PM

you would need to create a method that contains an infinite loop, within that loop you need to cycle through the index i of objects with the for each statement and use an if statement to see if whatever is within the threshold of object at index i. then make the method run when the world starts and it should continually check for collision
   
Reply With Quote
Old
nickster654
Senior Member
 
Status: Offline
Posts: 180
Join Date: Feb 2011
Location: nickster12345678@gmail.com
Default 04-17-2011, 08:12 PM

Quote:
Originally Posted by kompsci View Post
you would need to create a method that contains an infinite loop, within that loop you need to cycle through the index i of objects with the for each statement and use an if statement to see if whatever is within the threshold of object at index i. then make the method run when the world starts and it should continually check for collision
uhm, what? show me an example please
   
Reply With Quote
Old
kompsci
Guest
 
Status:
Posts: n/a
Default 04-17-2011, 08:18 PM

Quote:
Originally Posted by nickster654 View Post
uhm, what? show me an example please
i cant really show you an example lol


click world in the panel thats in the top left of the UI, go to methods in the tab list thingy that has "properties" "methods" and "functions" as the tabs. click new method, then drag a loop up from the bottom of the method pane that should have opened when you created a new method. select infinite loop, then put a for each loop inside that loop, and then an if statement.

ohh and i didnt see that you didnt have the list yet

make a list by going to world, then to the properties tab, then new variable, name it, then select object from the radio button, then check make list, and add your asteroids to the list

Last edited by kompsci; 04-17-2011 at 08:29 PM.
   
Reply With Quote
Reply


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 ©2024, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.