[client] resource images rename
This commit is contained in:
@@ -9,7 +9,7 @@ views:
|
||||
pHeight: 100
|
||||
skin:
|
||||
$type: haxework.gui.skin.BitmapSkin
|
||||
image: "@asset:image:resources/images/background.png"
|
||||
image: "@asset:image:resources/image/ui/background.png"
|
||||
fillType: REPEAT
|
||||
views:
|
||||
- id: start
|
||||
|
||||
@@ -4,9 +4,9 @@ button:
|
||||
height: 60
|
||||
skin:
|
||||
$type: haxework.gui.skin.ButtonBitmapSkin
|
||||
upImage: "@asset:image:resources/images/control/button_normal.png"
|
||||
downImage: "@asset:image:resources/images/control/button_down.png"
|
||||
overImage: "@asset:image:resources/images/control/button_over.png"
|
||||
upImage: "@asset:image:resources/image/ui/button/normal.png"
|
||||
downImage: "@asset:image:resources/image/ui/button/down.png"
|
||||
overImage: "@asset:image:resources/image/ui/button/over.png"
|
||||
fillType: NINEPATH
|
||||
fontFamily: "@res:text:font"
|
||||
fontEmbed: true
|
||||
|
||||
@@ -3,7 +3,7 @@ pWidth: 100
|
||||
pHeight: 100
|
||||
views:
|
||||
- $type: haxework.gui.ImageView
|
||||
image: "@asset:image:resources/images/logo/logo.png"
|
||||
image: "@asset:image:resources/image/ui/logo.png"
|
||||
contentSize: true
|
||||
bottomMargin: 15
|
||||
- $type: haxework.gui.LabelView
|
||||
|
||||
@@ -12,7 +12,8 @@ import ru.m.tankz.Type;
|
||||
|
||||
class AnimateBundle {
|
||||
|
||||
private static function buildAnimate(template:String, sequence:Array<Int>):OnceAnimate {
|
||||
private static function buildAnimate(name:String, sequence:Array<Int>):OnceAnimate {
|
||||
var template:String = 'resources/image/animate/${name}/%index%.png';
|
||||
var frames = [for (i in sequence) ({
|
||||
image: Assets.getBitmapData(StringTools.replace(template, '%index%', Std.string(i))),
|
||||
length: 1
|
||||
@@ -21,32 +22,41 @@ class AnimateBundle {
|
||||
}
|
||||
|
||||
public static function tankSpawn():OnceAnimate {
|
||||
return buildAnimate('resources/images/tank/appear/appear-%index%.png', [
|
||||
return buildAnimate('appear', [
|
||||
0, 1, 2, 3, 3, 4, 5, 5, 6
|
||||
]);
|
||||
}
|
||||
|
||||
public static function tankBoom():OnceAnimate {
|
||||
return buildAnimate('resources/images/tank/kaboom/kaboom-%index%.png', [
|
||||
return buildAnimate('boom', [
|
||||
0, 1, 2, 3, 4, 4, 4, 1, 4, 4, 7, 7, 8, 9, 9
|
||||
]);
|
||||
}
|
||||
|
||||
public static function bulletBoom():OnceAnimate {
|
||||
return buildAnimate('resources/images/bullet/boom/boom-%index%.png', [
|
||||
return buildAnimate('boom-sm', [
|
||||
0, 1, 1, 0, 0, 1
|
||||
]);
|
||||
}
|
||||
|
||||
public static function tankProtect():Animate {
|
||||
return new Animate([for (i in 0...2) ({
|
||||
image: Assets.getBitmapData('resources/images/tank/protect/protect-${i}.png'),
|
||||
image: Assets.getBitmapData('resources/image/animate/protect/${i}.png'),
|
||||
length: 5
|
||||
})]);
|
||||
}
|
||||
|
||||
public static function tankFrames(tank:Tank):Array<Frame> {
|
||||
var colors:Array<Color> = [tank.color, tank.bonus ? 0xff00aa : tank.color];
|
||||
var color:Color = switch (tank.hits) {
|
||||
case 1: 0x869C43;
|
||||
case 2: 0xDEAF80;
|
||||
case 3: 0x5EA67A;
|
||||
case _: tank.color;
|
||||
}
|
||||
var colors:Array<Color> = [color, color];
|
||||
if (tank.bonus) {
|
||||
colors[1] = 0xff00aa;
|
||||
}
|
||||
return [for (i in 0...2) ({
|
||||
image: BitmapUtil.colorize(Assets.getBitmapData('resources/image/tank/${tank.config.skin}-${i}.png'), colors[i]),
|
||||
length: 3
|
||||
|
||||
@@ -119,13 +119,13 @@ class Render extends SpriteView implements EngineListener {
|
||||
case EntityType.BONUS(bonus):
|
||||
var item = new BonusItem(bonus);
|
||||
items.set(bonus.key, item);
|
||||
entryLayer.addChild(item.view);
|
||||
upperLayer.addChild(item.view);
|
||||
item.update();
|
||||
case _:
|
||||
}
|
||||
}
|
||||
|
||||
public function onChange(entity:EntityType):Void {}
|
||||
public function onChange(entity:EntityType, ?change:EntityChange):Void {}
|
||||
|
||||
public function onCollision(entity:EntityType, with:EntityType):Void {
|
||||
switch [entity, with] {
|
||||
@@ -154,7 +154,7 @@ class Render extends SpriteView implements EngineListener {
|
||||
}
|
||||
case EntityType.BONUS(bonus):
|
||||
if (items.exists(bonus.key)) {
|
||||
entryLayer.removeChild(items.get(bonus.key).view);
|
||||
upperLayer.removeChild(items.get(bonus.key).view);
|
||||
items.remove(bonus.key);
|
||||
}
|
||||
case _:
|
||||
|
||||
@@ -242,7 +242,9 @@ class TankItem extends RenderItem<Tank, Sprite> {
|
||||
class BulletItem extends BitmapItem<Bullet> {
|
||||
|
||||
override private function getImage():String {
|
||||
return 'resources/images/bullet/bullet_${value.config.piercing > 1 ? 1 : 0}.png';
|
||||
var type:String = 'normal';
|
||||
if (value.config.piercing > 0) type = 'piercing';
|
||||
return 'resources/image/bullet/${type}.png';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user