This commit is contained in:
2015-08-14 16:46:29 +03:00
parent 3643be4cd8
commit 2099171d33
8 changed files with 4 additions and 22 deletions

View File

@@ -1,11 +1,6 @@
{ {
"pWidth": 100, "pHeight": 100, "pWidth": 100, "pHeight": 100,
"views": [ "views": [
{
"id": "name", "@type": "haxework.gui.LabelView",
"pWidth": 100, "height": 44, "text": "",
"@style": "label"
},
{ {
"id": "render", "@type": "ru.m.tankz.render.Render", "id": "render", "@type": "ru.m.tankz.render.Render",
"contentSize": true "contentSize": true

View File

@@ -1,11 +1,6 @@
{ {
"pWidth": 100, "pHeight": 100, "pWidth": 100, "pHeight": 100,
"views": [ "views": [
{
"id": "name", "@type": "haxework.gui.LabelView",
"pWidth": 100, "height": 44, "text": "",
"@style": "label"
},
{ {
"id": "create", "@type": "haxework.gui.ButtonView", "id": "create", "@type": "haxework.gui.ButtonView",
"width": 132, "height": 44, "width": 132, "height": 44,

View File

@@ -1,11 +1,6 @@
{ {
"pWidth": 100, "pHeight": 100, "pWidth": 100, "pHeight": 100,
"views": [ "views": [
{
"id": "name", "@type": "haxework.gui.LabelView",
"pWidth": 100, "height": 44, "text": "",
"@style": "label"
},
{ {
"id": "start", "@type": "haxework.gui.ButtonView", "id": "start", "@type": "haxework.gui.ButtonView",
"width": 132, "height": 44, "width": 132, "height": 44,

View File

@@ -82,6 +82,6 @@ class Render extends SpriteView implements IRender {
90; 90;
} else { } else {
0; 0;
}) / (Math.PI * 2); }) * (Math.PI / 180);
} }
} }

View File

@@ -27,7 +27,6 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
public function onShow():Void { public function onShow():Void {
var person = Provider.get(GameData).person; var person = Provider.get(GameData).person;
var persons = Provider.get(GameData).game.persons; var persons = Provider.get(GameData).game.persons;
name.text = person.name;
engine.personId = person.id; engine.personId = person.id;
engine.init(DEFAULT.CONFIG); engine.init(DEFAULT.CONFIG);
content.addEventListener(Event.ENTER_FRAME, updateGame); content.addEventListener(Event.ENTER_FRAME, updateGame);

View File

@@ -27,13 +27,11 @@ class GameListFrame extends VGroupView implements ViewBuilder implements IPacket
public static inline var ID = "game_list"; public static inline var ID = "game_list";
public function init() { public function init() {
list = findViewById("list");
list.dispatcher.addListener(this); list.dispatcher.addListener(this);
findViewById("create", ButtonView).onPress = this; findViewById("create", ButtonView).onPress = this;
} }
public function onShow() { public function onShow() {
findViewById("name", LabelView).text = Provider.get(GameData).person.name;
Provider.get(IConnection).packetHandler.addListener(this); Provider.get(IConnection).packetHandler.addListener(this);
Provider.get(IConnection).send(new GamesSubscribeRequest()); Provider.get(IConnection).send(new GamesSubscribeRequest());
} }

View File

@@ -31,7 +31,7 @@ class NekoConnection extends BaseConnection {
socket.output.write(bytes); socket.output.write(bytes);
socket.output.flush(); socket.output.flush();
} catch (e:Dynamic) { } catch (e:Dynamic) {
trace("Error send packet: " + packet); trace("Error send packet: " + Type.getClassName(Type.getClass(packet)));
trace(e); trace(e);
} }
} }

View File

@@ -71,11 +71,11 @@ class Engine implements IEngine {
case GameChangeType.APPEND: case GameChangeType.APPEND:
switch (change.objectType) { switch (change.objectType) {
case GameObjectType.TANK: case GameObjectType.TANK:
var tank:Tank = buildTank(change.personId, change.objectId, change.x, change.y, Direction.from(change.directionY, change.directionY)); var tank:Tank = buildTank(change.personId, change.objectId, change.x, change.y, Direction.from(change.directionX, change.directionY));
mobileEntities.set(tank.id, tank); mobileEntities.set(tank.id, tank);
tanks.set(tank.personId, tank); tanks.set(tank.personId, tank);
case GameObjectType.BULLET: case GameObjectType.BULLET:
var bullet:Bullet = new Bullet(change.personId, change.objectId, change.x, change.y, 0, Direction.from(change.directionY, change.directionY)); var bullet:Bullet = new Bullet(change.personId, change.objectId, change.x, change.y, 0, Direction.from(change.directionX, change.directionY));
mobileEntities.set(bullet.id, bullet); mobileEntities.set(bullet.id, bullet);
} }
case GameChangeType.DESTROED: case GameChangeType.DESTROED: