-
please help
i stuck with duplicte movie clip(DMC)and hit test
I am creating Partical Motion Game where partiacal collides with each other and No. of parical Are user defined, The problem is how to detect collusion between duplicate movie clip any body please help me
Mac007x
-
Senior Member
Hi, keep in mind for the so called explosive growth when you try to do collision detection for each element this might crash your computer if you put too many particles or will slow down definetely. Anyway:
keep a variable wich will point the number of particles:
do a loop inside each particle to check for collision with hitTest()
myNumber=5; for example this is the 5th particle
for (i=1,i<numPart,i++){
if ( i==myNumber ){ i=i+1;}- dont check collision with myself
hitTest ( _root["particle" add i])){
===============
actions go here
===============
}}
hope this helps
mad_sci
PS I would also suggest if you give each particle life using GetTimer. In other words remove the particle after a while.
-
Thank U for help but it`s not working here is code for
buttion that having following Action for (DMC)
on (release) {
if (i<100) {
i++;
top++;
}
duplicateMovieClip ("Block", "Block"+i, i);
setProperty ("Block"+i, _x, Random(408)+60);
setProperty ("Block"+i, _y, Random(471)+30);
}
-------------------
Now where should i put Action who i will get New name for movie clip please help me
I think u Can help me .............:-)
So,
Waiting For Reply
Mac007x
[Edited by mac007x on 01-22-2001 at 09:23 AM]
-
...
i am having the same problem as you. It is that once you create a bunch of numbered duplicated movie clips it is hard to find out which numbered one has been affeted. I am trying to investigate the eval() function that seems to return the value of the spacific mc.
-
oh yeah ...
you can also refere to each new mc as
["block"+i]
or maybe,
_root["block"+NUMBER]
I wan to find out dynamicly which one has been hit.
-
yes good input i will try that, i think you also try
let's hope it will work, if it's work please contact me nikku where is mad-sci i am waiting for answer..
waiting for solution
mac007x
-
Yeah, I have a very similar problem myself.
Duplicating a movie clip I'm using for a projectile, I have to check when a movie collides with the character movie clip. I've tried various methods of using hitTest, including putting the command inside the projectile clip to be copied, but I cannot get a result.
Any suggestions?
-
Senior Member
Hi guys somehow I missed this post. Sorry about it ok down to busness:
mac007x code:
============
on (release) {
if (i<100) {
i++;
top++;
}
duplicateMovieClip ("Block", "Block"+i, i);
setProperty ("Block"+i, _x, Random(408)+60);
setProperty ("Block"+i, _y, Random(471)+30);
}
replace with:
-------------
on (release) {
while (i<100) {
i++;
top++;
duplicateMovieClip (_root.Block,_root["Block" add i],100+ i);
setProperty (_root["Block" add i] , _x, Random(408)+60);
setProperty (-root["Block" add i] , _y, Random(471)+30);
}
}
How that works ?
mad_sci
-
i don't understand it is not working ??
hi thankx but i tried but not working but it should work
after export it's taking too much of time and after clicking on bution Stage is moving toward movie clip mut it is not duplicating i don't no what is happeing in code
I will try to host the .FLA file So Anybody can see and understand our problem isn't it "niiku", "The_Offspring"..
See u soon
Mac007x
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|