[editor] update Frames

This commit is contained in:
2019-06-25 17:36:31 +03:00
parent bc95ca03e2
commit 9640414ba4
13 changed files with 69 additions and 198 deletions

View File

@@ -53,13 +53,6 @@ import ru.m.tankz.Type;
private function changePause(value:Bool):Void {}
private function applyPosition(entity:Entity, position:Position):Void {
entity.rect.center = new Point(position.x, position.y);
if (position.direction != null) {
entity.rect.direction = position.direction;
}
}
public inline function getTeam(teamId:TeamId):Team {
return teams[teamId];
}
@@ -75,9 +68,6 @@ import ru.m.tankz.Type;
case COMPLETE(result):
this.state = result.state;
this.winner = result.winner;
case SPAWN(EAGLE(id, rect, teamId)):
var team = getTeam(teamId);
team.eagleId = id;
case SPAWN(TANK(id, rect, playerId, info)):
if (controls.exists(playerId)) {
var control = controls[playerId];

View File

@@ -383,6 +383,9 @@ class GameRunner extends Game implements EngineListener {
case ACTION(tankId, STOP):
gameEventSignal.emit(STOP(TANK(tankId)));
engine.stop(tankId);
case SPAWN(EAGLE(id, rect, teamId)):
var team = getTeam(teamId);
team.eagleId = id;
case SPAWN(BULLET(_, _, playerId, _)):
getPlayer(playerId).bullets++;
case DESTROY(EAGLE(id, shot)):

View File

@@ -1,12 +1,9 @@
package ru.m.tankz.map;
import ru.m.tankz.config.Config.GridSize;
import ru.m.tankz.config.Config.CellSize;
import haxe.ds.HashMap;
import ru.m.geom.Line;
import ru.m.geom.Point;
import ru.m.geom.Rectangle;
import haxe.ds.HashMap;
class GridCell {
public var cellX(default, null):Int;
@@ -42,7 +39,6 @@ class GridCell {
}
}
class Grid {
public var cellWidth(default, null):Int;
public var cellHeight(default, null):Int;

View File

@@ -1,11 +1,9 @@
package ru.m.tankz.map;
import ru.m.tankz.Type.BrickType;
import haxe.ds.HashMap;
import ru.m.tankz.map.Grid;
import ru.m.geom.Point;
import ru.m.tankz.config.Config;
import ru.m.tankz.map.Grid;
class LevelMap {
@@ -30,7 +28,7 @@ class LevelMap {
cellWidth = config.cell.width;
cellHeight = config.cell.width;
gridWidth = size != null ? size.width : config.grid.width;
gridHeight = size != null ? size.height : config.grid.width;
gridHeight = size != null ? size.height : config.grid.height;
bricksMap = new HashMap();
bricks = [];
grid = new Grid(