[client] set FPS to 60
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user