USERNAME:
PASSWORD:
Save Info!
Logging in…
This topic is 1 page long.
[ Profile | Posts | Contact ]
Posted at: 6/6/06 05:14 PM
Sign-Up: 06/04/06
Posts: 1
Eyess... I have clip1xx and clip2xx where xx can be anything, and I want to do a hittest between them so I can destroy clip1 on contact.
Any ideas?
Posted at: 6/6/06 09:31 PM
Sign-Up: 07/02/04
Posts: 1,247
Ok, the xx being anything is bad, try to limit it to between 1 - 50 or 1 - 100.
Then entr the world of for loops!
for(q=1;q<50;q++){ ['clip'+q] code here! }
the "for(q=1;q<30;q++)" will run this loop, increasing q by 1 each time it runs, until q = 50.
so it will test clip1 - 50, just refer to the clip with the Q as i have done "['clip'+q]"
make sense?
Posted at: 6/6/06 09:46 PM
Sign-Up: 12/28/04
Posts: 7,063
you could push the MC's into an array then iterate through the array too
Glaiel Games | Glaiel Mart
Posted at: 6/6/06 09:50 PM
Sign-Up: 01/14/05
Posts: 2,968
or something like this for (i in _root) { if (_root[i]._name.indexOf("enemy") != -1) { //actions } }
Change enemy to whatever you want.
Posted at: 6/6/06 09:52 PM
Sign-Up: 08/04/05
Posts: 6,957
At 6/6/06 09:50 PM, pyro111 wrote: or something like this for (i in _root) { if (_root[i]._name.indexOf("enemy") != -1) { //actions } } Change enemy to whatever you want.
in this case you would use:
for(i in _root){ if(_root[i]._name.indexOf("clip")!=-1){ if(_root[i].hitTest(something)){ actions; } } }
Note that youd reffer to your "clips" as _root[i].
Posted at: 6/6/06 10:05 PM
At 6/6/06 09:52 PM, Darkfire_Blaze wrote: stuff
I figured if hes coding a game he would understand a hitTest and be able to read the code. But I guess not.
All times are Eastern Standard Time (GMT -5) | Current Time: 07:56 AM
<< Back