Hi,
I write this message as a SOS. I tried everything I could and searched everywhere… I am doing a little game jam with a friend and got stucked near the end…
I got an Entity class Tornado. Those one are created when the player left click and they are two types of tornadoes : blue and red. We did a red animation and a blue animation. Everything is good, when I click, a tornado pops on my mouseX/Y and the animation goes on.
BUT, I would like to be able to create multiple tornado, I mean, when I click again, I don’t wan’t the last one to get deleted. The two conditions for them to be deleted would be : their animation is over (like 7 images) or a collide is detected between it and another entity I determined.
I tried everything to create an Array and stock them in, but nothing I do is the right thing
The last thing I tried is :
public class Wave extends Entity
{
[Embed(source="Assets/Wave[ANIM].png")]
private const wave:Class;
public var sprWave:Spritemap = new Spritemap(wave, 72, 72);
public var redarray:Array = new Array();
public var e:Spritemap;
public function Wave()
{
sprWave.add("red", [0, 1, 2, 3, 4, 5, 6, 7], 10, false);
sprWave.add("blue", [8, 9, 10, 11, 12, 13, 14, 15], 10, false);
type = "onde";
}
override public function update():void
{
if (Input.mouseReleased && GameVariables.mouseState == true) {
e = sprWave;
e.x = Input.mouseX;
e.y = Input.mouseY;
e.play("red", true);
addGraphic(e);
redarray.push(e);
}
}