[common] tanks spawn types

This commit is contained in:
2018-02-02 20:53:26 +03:00
parent f9cb985059
commit 59cab68e3e
15 changed files with 202 additions and 52 deletions

View File

@@ -26,17 +26,28 @@ class Animate extends Bitmap {
}
}
private static var a = new BitmapData(1, 1);
public var playing(default, set):Bool;
private var frames:Array<BitmapData>;
public var frames(default, set):Array<BitmapData>;
private var index:Int;
public function new(frames:Array<BitmapData>) {
super(frames[0], PixelSnapping.AUTO, true);
this.frames = frames;
public function new(?frames:Array<BitmapData>) {
super(null, PixelSnapping.AUTO, true);
this.frames = frames == null ? [] : frames;
init();
instances.push(this);
}
public function set_frames(value:Array<BitmapData>):Array<BitmapData> {
if (value != null) {
frames = value;
bitmapData = frames[0];
index = 0;
}
return frames;
}
public function set_playing(value:Bool):Bool {
if (playing != value) {
playing = value;