[client] render fixes

This commit is contained in:
2018-02-10 15:25:16 +03:00
parent 41c5610f9a
commit a1ed498bf5
13 changed files with 21 additions and 20 deletions

View File

@@ -153,14 +153,17 @@ class TankItem extends RenderItem<Tank, Sprite> {
override public function redraw():Void {
var colors:Array<Color> = [value.color, value.bonus ? 0xff00aa : value.color];
tankView.frames = getFrames().map(function(src) return BitmapUtil.colorize(Assets.getBitmapData(src), colors.shift()));
var frames = [for (frame in getFrames()) BitmapUtil.colorize(Assets.getBitmapData(frame), colors.shift())];
tankView.frames = [
frames[0], frames[0], frames[0],
frames[1], frames[1], frames[1],
];
}
private function getFrames():Array<String> {
return [
'resources/image/tank/${value.config.skin}-0.png',
'resources/image/tank/${value.config.skin}-1.png',
];
var frame0 = 'resources/image/tank/${value.config.skin}-0.png';
var frame1 = 'resources/image/tank/${value.config.skin}-1.png';
return [frame1, frame0];
}
override public function update():Void {
@@ -210,11 +213,9 @@ class BonusItem extends AnimateItem<Bonus> {
}
override public function redraw():Void {
// ToDo: 15/15 frames
view.frames = [
Assets.getBitmapData('resources/image/bonus/${value.bonusType}.png'),
new BitmapData(1, 1),
];
var image = Assets.getBitmapData('resources/image/bonus/${value.bonusType}.png');
var empty = new BitmapData(image.width, image.height, true, 0x00000000);
view.frames = [for (i in 0...15) image].concat([for (i in 0...15) empty]);
view.playing = true;
}
}

View File

@@ -24,10 +24,10 @@ teams:
- id: bot
spawnInterval: 3000
tanks:
- {type: bot0, rate: 0.25, bonus: 1}
- {type: bot1, rate: 0.25, bonus: 1}
- {type: bot2, rate: 0.25, bonus: 1}
- {type: bot3, rate: 0.25, bonus: 1}
- {type: bot0, rate: 0.25, bonus: 0.25}
- {type: bot1, rate: 0.25, bonus: 0.25}
- {type: bot2, rate: 0.25, bonus: 0.25}
- {type: bot3, rate: 0.25, bonus: 0.25}
points:
- {team: human, type: eagle, index: -1, direction: right, x: 12, y: 24}

View File

@@ -54,10 +54,10 @@ tanks:
- type: slow
width: 38
height: 36
speed: 2.0
speed: 2.3
bullet:
<<: *bullet
speed: 10.0
speed: 12.0
bullets: 1
skin: bc
@@ -67,7 +67,7 @@ tanks:
speed: 4.0
bullet:
<<: *bullet
speed: 7.0
speed: 8.0
bullets: 1
skin: bb

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@@ -15,8 +15,8 @@ class ClassicGame extends Game {
public static var HUMAN(default, never):TeamId = 'human';
public static var BOT(default, never):TeamId = 'bot';
private static var PLAYER1_COLOR:Color = 0xffff55;
private static var PLAYER2_COLOR:Color = 0x00ff00;
private static var PLAYER1_COLOR:Color = 0xFC9838;
private static var PLAYER2_COLOR:Color = 0x159D49;
public static var PLAYER1(default, never):GameMode = [
{team:HUMAN, type:Control.HUMAN, color: PLAYER1_COLOR, index:0}