update worklist

This commit is contained in:
2018-02-04 14:11:43 +03:00
parent 59cab68e3e
commit e0ceff68f9
5 changed files with 78 additions and 52 deletions

View File

@@ -101,6 +101,7 @@ class Render extends SpriteView implements EngineListener {
items.set(tank.key, item);
entryLayer.addChild(item.view);
item.update();
playTankSpawn(tank.rect.center);
case EntityType.BULLET(bullet):
var item = new BulletItem(bullet);
items.set(bullet.key, item);
@@ -143,6 +144,21 @@ class Render extends SpriteView implements EngineListener {
}
}
private function playTankSpawn(point:Point):Void {
var arr = [
0, 1, 2, 3, 3, 4, 5, 5, 6
];
var frames = [for (i in arr) Assets.getBitmapData('resources/images/tank/appear/appear-${i}.png')];
var animate = new OnceAnimate(frames);
animate.x = point.x - animate.width / 2;
animate.y = point.y - animate.height / 2;
upperLayer.addChild(animate);
animate.play().then(function(animate) {
upperLayer.removeChild(animate);
animate.dispose();
});
}
private function playBulletBoom(point:Point):Void {
var arr = [
0, 1, 1, 0, 0, 1