Copy link to clipboard
Copied
I'm making a bullet hell but i've encountered a slight problem, I can't use just one sprite for everything and manually animating each attack would be way too time-consuming, Is it possible for symbols to be duplicated through actionscript?
The example here is what i know how to do, being the use of a single object on loop in a set path.
But what i need is for a single stationary object to be able to create duplicates of itself when a function is called, then have those clones do a desired action or go on a set path. As shown below.
make your bullet a movieclip
assign a linkage id (ie, class name), eg Bullet_mc. if you don't need it to have any properties/methods, let animate create the class for you, but youi might want to remove the bullets (from the display list and ready them for gc) when they're not visible.
either way, you can use:
var bullet1:Bullet_mc = new Bullet_mc(); // to create a bullet instance
addChild(bullet1); to add it to stage
Copy link to clipboard
Copied
make your bullet a movieclip
assign a linkage id (ie, class name), eg Bullet_mc. if you don't need it to have any properties/methods, let animate create the class for you, but youi might want to remove the bullets (from the display list and ready them for gc) when they're not visible.
either way, you can use:
var bullet1:Bullet_mc = new Bullet_mc(); // to create a bullet instance
addChild(bullet1); to add it to stage