-
.draw on a group of movieclips
Hey everyone,
In a game I am making, I want bullets and missiles to leave a trail behind,
so I'm using bitmapdata, drawing each bullet individually using matrix for them to appear in the right spot, like so...
Code:
function drawbmp(MC:Object) {
matrix.ty = MC._y;
matrix.tx = MC._x;
matrix.a = Math.cos(MC._rotation/(180/Math.PI));
matrix.b = Math.sin(MC._rotation/(180/Math.PI));
matrix.c = -Math.sin(MC._rotation/(180/Math.PI));
matrix.d = Math.cos(MC._rotation/(180/Math.PI));
fadebmp.draw(MC,matrix);
}
I was wondering if there was a way to "group" for example every bullet movieclip inside another movieclip/layer/whatever so I could draw them all at once, much like what happens when you draw _root...
Code:
fadebmp.draw(_root)
Only then not only bullets appear, but the character and UI.
I was thinking maybe I could use "attachMovieClip" instead of "duplicateMovieClip" to stick them to another MC, but I have code inside the MC I'm duplicating, anything I can do to like copy the code of a MC inside another one ?
Or simply "attach" existing MC to a container of some kind ?
Thx alot
-
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
|