From 5db3ae1af0e19590f66f8796c2c4b4eb88450c20 Mon Sep 17 00:00:00 2001 From: shmyga Date: Mon, 20 May 2019 17:11:50 +0300 Subject: [PATCH] [client] set FPS to 60 --- gulpfile.js | 4 ++-- package.json | 8 ++++---- src/client/haxe/ru/m/tankz/Client.hx | 6 ++++++ src/client/haxe/ru/m/tankz/render/item/BonusRenderItem.hx | 8 +++++--- src/client/haxe/ru/m/tankz/render/item/TankRenderItem.hx | 5 +---- src/common/haxe/ru/m/tankz/game/GameRunner.hx | 1 + 6 files changed, 19 insertions(+), 13 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 90aff84..559ed4a 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -140,9 +140,9 @@ module.exports.default = gulp.series( module.exports['client:linux:deb'], //module.exports['client:android:build'], - /*module.exports['editor:flash:build'], + module.exports['editor:flash:build'], module.exports['editor:flash:html'], - module.exports['editor:html5:build'],*/ + module.exports['editor:html5:build'], //module.exports['server:neko:build'], ); diff --git a/package.json b/package.json index c1c0626..555d406 100755 --- a/package.json +++ b/package.json @@ -1,18 +1,18 @@ { "name": "tankz", - "version": "0.11.0", + "version": "0.11.1", "private": true, "devDependencies": { "dateformat": "^3.0.3", "gulp": "^4.0.0", "gulp-add": "0.0.2", "gulp-clean": "^0.4.0", - "gulp-haxetool": "^0.0.17" + "gulp-haxetool": "^0.0.19" }, "haxeDependencies": { "haxework": "git@bitbucket.org:shmyga/haxework.git", - "lime": "7.3.0", - "openfl": "8.9.0", + "lime": "7.5.0", + "openfl": "8.9.1", "hxcpp": "4.0.8", "promhx": "1.1.0", "protohx": "0.4.6", diff --git a/src/client/haxe/ru/m/tankz/Client.hx b/src/client/haxe/ru/m/tankz/Client.hx index dc2b34d..68e0d29 100755 --- a/src/client/haxe/ru/m/tankz/Client.hx +++ b/src/client/haxe/ru/m/tankz/Client.hx @@ -1,5 +1,6 @@ package ru.m.tankz; +import openfl.display.FPS; import ru.m.tankz.view.ClientView; import flash.Lib; import haxework.animate.Animate; @@ -32,5 +33,10 @@ class Client { var view:ClientView = new ClientView(); Root.bind(view); view.launch(); + + #if debug + var fps = new FPS(0, 0, 0x00ff00); + view.content.addChild(fps); + #end } } diff --git a/src/client/haxe/ru/m/tankz/render/item/BonusRenderItem.hx b/src/client/haxe/ru/m/tankz/render/item/BonusRenderItem.hx index 109ee67..c2def45 100644 --- a/src/client/haxe/ru/m/tankz/render/item/BonusRenderItem.hx +++ b/src/client/haxe/ru/m/tankz/render/item/BonusRenderItem.hx @@ -6,7 +6,8 @@ import ru.m.tankz.Type; class BonusRenderItem extends BitmapRenderItem { public var type(default, set):BonusType; - private var d = 0.1; + private var d = -0.05; + private var alpha = 1.0; public function new(rect:Rectangle, type:BonusType) { super(rect); @@ -24,8 +25,9 @@ class BonusRenderItem extends BitmapRenderItem { override public function update():Void { super.update(); - view.alpha += d; - if (view.alpha < 0 || view.alpha > 1.5) { + alpha += d; + view.alpha = alpha; + if (alpha <= 0 || alpha >= 1.5) { d = -d; } } diff --git a/src/client/haxe/ru/m/tankz/render/item/TankRenderItem.hx b/src/client/haxe/ru/m/tankz/render/item/TankRenderItem.hx index f3dc08c..edc9b39 100644 --- a/src/client/haxe/ru/m/tankz/render/item/TankRenderItem.hx +++ b/src/client/haxe/ru/m/tankz/render/item/TankRenderItem.hx @@ -55,10 +55,7 @@ class TankRenderItem extends BitmapRenderItem { if (!color1.zero) { image2 = BitmapUtil.colorize(image2, color2); } - images = [ - image1, image1, image1, - image2, image2, image2, - ]; + images = [for (i in 0...6) image1].concat([for (i in 0...6) image2]); frame = 0; bitmap.bitmapData = images[frame]; } diff --git a/src/common/haxe/ru/m/tankz/game/GameRunner.hx b/src/common/haxe/ru/m/tankz/game/GameRunner.hx index 668d92b..e61a622 100644 --- a/src/common/haxe/ru/m/tankz/game/GameRunner.hx +++ b/src/common/haxe/ru/m/tankz/game/GameRunner.hx @@ -76,6 +76,7 @@ class GameRunner implements EngineListener implements GameListener { } gameEventSignal.emit(EventUtil.buildBricksSpawn(game.engine.map)); gameEventSignal.emit(GameEvent.START(state)); + for (i in 0...10) spawnBonus(); } public function next():Option {