[editor] tank color view

This commit is contained in:
2018-02-13 22:32:21 +03:00
parent 4fc0ae103e
commit 1f8b43ba5d
14 changed files with 155 additions and 37 deletions

View File

@@ -79,12 +79,25 @@ class BitmapItem<T:TRectangle> extends RenderItem<T, Bitmap> {
class BrickItem extends BitmapItem<Brick> {
private var type:BrickType;
public function new(value:Brick) {
super(value);
redraw();
}
override public function update():Void {
super.update();
var t = value.config.type;
if (t != type) {
type = t;
view.visible = t != 'none';
redraw();
}
}
override private function getImage():String {
return 'resources/image/map/${value.config.type}.png';
}
@@ -108,7 +121,6 @@ class BrickAnimateItem extends AnimateItem<Brick> {
class BrickBreakingItem extends RenderItem<Brick, Shape> {
private var broken:Int;
private var type:BrickType;