[common] tanks and bullets config
This commit is contained in:
@@ -157,23 +157,24 @@ class Render extends SpriteView implements IRender {
|
||||
if (layersForUpdate[entryLayer]) {
|
||||
var g:Graphics = entryLayer.graphics;
|
||||
g.clear();
|
||||
for (ent in game.entities) if (Std.is(ent, IMobileEntity)) {
|
||||
var e:IMobileEntity = cast ent;
|
||||
if (Std.is(e, Tank)) {
|
||||
for (ent in game.entities) {
|
||||
var image:String = null;
|
||||
if (Std.is(ent, Tank)) {
|
||||
image = 'resources/images/tank/player/tank_p0_${cast(ent, Tank).index}-0.png';
|
||||
} else if (Std.is(ent, Bullet)) {
|
||||
var m = new Matrix();
|
||||
m.rotate(calcRotate(e.direction));
|
||||
m.translate(e.rect.x, e.rect.y);
|
||||
g.beginBitmapFill(Assets.getBitmapData("resources/images/tank/player/tank_p0_0-0.png"), m);
|
||||
g.drawRect(e.rect.x, e.rect.y, e.rect.width, e.rect.height);
|
||||
g.endFill();
|
||||
} else if (Std.is(e, Bullet)) {
|
||||
var m = new Matrix();
|
||||
m.rotate(calcRotate(e.direction));
|
||||
m.translate(e.rect.x, e.rect.y);
|
||||
g.beginBitmapFill(Assets.getBitmapData("resources/images/bullet/bullet_0.png"), m);
|
||||
g.drawRect(e.rect.x, e.rect.y, e.rect.width, e.rect.height);
|
||||
g.endFill();
|
||||
image = 'resources/images/bullet/bullet_0.png';
|
||||
} else {
|
||||
image = 'ERROR'; // ToDo:
|
||||
}
|
||||
var m = new Matrix();
|
||||
if (Std.is(ent, IMobileEntity)) {
|
||||
m.rotate(calcRotate(cast(ent, IMobileEntity).direction));
|
||||
}
|
||||
m.translate(ent.rect.x, ent.rect.y);
|
||||
g.beginBitmapFill(Assets.getBitmapData(image), m);
|
||||
g.drawRect(ent.rect.x, ent.rect.y, ent.rect.width, ent.rect.height);
|
||||
g.endFill();
|
||||
}
|
||||
layersForUpdate[entryLayer] = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user