[client] render fixes
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "tankz",
|
"name": "tankz",
|
||||||
"version": "0.5.1",
|
"version": "0.6.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ansi-colors": "^1.0.1",
|
"ansi-colors": "^1.0.1",
|
||||||
|
|||||||
@@ -153,14 +153,17 @@ class TankItem extends RenderItem<Tank, Sprite> {
|
|||||||
|
|
||||||
override public function redraw():Void {
|
override public function redraw():Void {
|
||||||
var colors:Array<Color> = [value.color, value.bonus ? 0xff00aa : value.color];
|
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> {
|
private function getFrames():Array<String> {
|
||||||
return [
|
var frame0 = 'resources/image/tank/${value.config.skin}-0.png';
|
||||||
'resources/image/tank/${value.config.skin}-0.png',
|
var frame1 = 'resources/image/tank/${value.config.skin}-1.png';
|
||||||
'resources/image/tank/${value.config.skin}-1.png',
|
return [frame1, frame0];
|
||||||
];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override public function update():Void {
|
override public function update():Void {
|
||||||
@@ -210,11 +213,9 @@ class BonusItem extends AnimateItem<Bonus> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override public function redraw():Void {
|
override public function redraw():Void {
|
||||||
// ToDo: 15/15 frames
|
var image = Assets.getBitmapData('resources/image/bonus/${value.bonusType}.png');
|
||||||
view.frames = [
|
var empty = new BitmapData(image.width, image.height, true, 0x00000000);
|
||||||
Assets.getBitmapData('resources/image/bonus/${value.bonusType}.png'),
|
view.frames = [for (i in 0...15) image].concat([for (i in 0...15) empty]);
|
||||||
new BitmapData(1, 1),
|
|
||||||
];
|
|
||||||
view.playing = true;
|
view.playing = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,10 +24,10 @@ teams:
|
|||||||
- id: bot
|
- id: bot
|
||||||
spawnInterval: 3000
|
spawnInterval: 3000
|
||||||
tanks:
|
tanks:
|
||||||
- {type: bot0, rate: 0.25, bonus: 1}
|
- {type: bot0, rate: 0.25, bonus: 0.25}
|
||||||
- {type: bot1, rate: 0.25, bonus: 1}
|
- {type: bot1, rate: 0.25, bonus: 0.25}
|
||||||
- {type: bot2, rate: 0.25, bonus: 1}
|
- {type: bot2, rate: 0.25, bonus: 0.25}
|
||||||
- {type: bot3, rate: 0.25, bonus: 1}
|
- {type: bot3, rate: 0.25, bonus: 0.25}
|
||||||
|
|
||||||
points:
|
points:
|
||||||
- {team: human, type: eagle, index: -1, direction: right, x: 12, y: 24}
|
- {team: human, type: eagle, index: -1, direction: right, x: 12, y: 24}
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ tanks:
|
|||||||
- type: slow
|
- type: slow
|
||||||
width: 38
|
width: 38
|
||||||
height: 36
|
height: 36
|
||||||
speed: 2.0
|
speed: 2.3
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 10.0
|
speed: 12.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
skin: bc
|
skin: bc
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ tanks:
|
|||||||
speed: 4.0
|
speed: 4.0
|
||||||
bullet:
|
bullet:
|
||||||
<<: *bullet
|
<<: *bullet
|
||||||
speed: 7.0
|
speed: 8.0
|
||||||
bullets: 1
|
bullets: 1
|
||||||
skin: bb
|
skin: bb
|
||||||
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.5 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.4 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -15,8 +15,8 @@ class ClassicGame extends Game {
|
|||||||
public static var HUMAN(default, never):TeamId = 'human';
|
public static var HUMAN(default, never):TeamId = 'human';
|
||||||
public static var BOT(default, never):TeamId = 'bot';
|
public static var BOT(default, never):TeamId = 'bot';
|
||||||
|
|
||||||
private static var PLAYER1_COLOR:Color = 0xffff55;
|
private static var PLAYER1_COLOR:Color = 0xFC9838;
|
||||||
private static var PLAYER2_COLOR:Color = 0x00ff00;
|
private static var PLAYER2_COLOR:Color = 0x159D49;
|
||||||
|
|
||||||
public static var PLAYER1(default, never):GameMode = [
|
public static var PLAYER1(default, never):GameMode = [
|
||||||
{team:HUMAN, type:Control.HUMAN, color: PLAYER1_COLOR, index:0}
|
{team:HUMAN, type:Control.HUMAN, color: PLAYER1_COLOR, index:0}
|
||||||
|
|||||||