[client] set FPS to 60

This commit is contained in:
2019-05-20 17:11:50 +03:00
parent bbe2aeb7fb
commit 5db3ae1af0
6 changed files with 19 additions and 13 deletions

View File

@@ -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'],
);

View File

@@ -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",

View File

@@ -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
}
}

View File

@@ -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;
}
}

View File

@@ -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];
}

View File

@@ -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<GameState> {