update
This commit is contained in:
@@ -1,11 +1,6 @@
|
||||
{
|
||||
"pWidth": 100, "pHeight": 100,
|
||||
"views": [
|
||||
{
|
||||
"id": "name", "@type": "haxework.gui.LabelView",
|
||||
"pWidth": 100, "height": 44, "text": "",
|
||||
"@style": "label"
|
||||
},
|
||||
{
|
||||
"id": "render", "@type": "ru.m.tankz.render.Render",
|
||||
"contentSize": true
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
{
|
||||
"pWidth": 100, "pHeight": 100,
|
||||
"views": [
|
||||
{
|
||||
"id": "name", "@type": "haxework.gui.LabelView",
|
||||
"pWidth": 100, "height": 44, "text": "",
|
||||
"@style": "label"
|
||||
},
|
||||
{
|
||||
"id": "create", "@type": "haxework.gui.ButtonView",
|
||||
"width": 132, "height": 44,
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
{
|
||||
"pWidth": 100, "pHeight": 100,
|
||||
"views": [
|
||||
{
|
||||
"id": "name", "@type": "haxework.gui.LabelView",
|
||||
"pWidth": 100, "height": 44, "text": "",
|
||||
"@style": "label"
|
||||
},
|
||||
{
|
||||
"id": "start", "@type": "haxework.gui.ButtonView",
|
||||
"width": 132, "height": 44,
|
||||
|
||||
@@ -82,6 +82,6 @@ class Render extends SpriteView implements IRender {
|
||||
90;
|
||||
} else {
|
||||
0;
|
||||
}) / (Math.PI * 2);
|
||||
}) * (Math.PI / 180);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,6 @@ class GameFrame extends VGroupView implements ViewBuilder implements IPacketHand
|
||||
public function onShow():Void {
|
||||
var person = Provider.get(GameData).person;
|
||||
var persons = Provider.get(GameData).game.persons;
|
||||
name.text = person.name;
|
||||
engine.personId = person.id;
|
||||
engine.init(DEFAULT.CONFIG);
|
||||
content.addEventListener(Event.ENTER_FRAME, updateGame);
|
||||
|
||||
@@ -27,13 +27,11 @@ class GameListFrame extends VGroupView implements ViewBuilder implements IPacket
|
||||
public static inline var ID = "game_list";
|
||||
|
||||
public function init() {
|
||||
list = findViewById("list");
|
||||
list.dispatcher.addListener(this);
|
||||
findViewById("create", ButtonView).onPress = this;
|
||||
}
|
||||
|
||||
public function onShow() {
|
||||
findViewById("name", LabelView).text = Provider.get(GameData).person.name;
|
||||
Provider.get(IConnection).packetHandler.addListener(this);
|
||||
Provider.get(IConnection).send(new GamesSubscribeRequest());
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ class NekoConnection extends BaseConnection {
|
||||
socket.output.write(bytes);
|
||||
socket.output.flush();
|
||||
} catch (e:Dynamic) {
|
||||
trace("Error send packet: " + packet);
|
||||
trace("Error send packet: " + Type.getClassName(Type.getClass(packet)));
|
||||
trace(e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,11 +71,11 @@ class Engine implements IEngine {
|
||||
case GameChangeType.APPEND:
|
||||
switch (change.objectType) {
|
||||
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);
|
||||
tanks.set(tank.personId, tank);
|
||||
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);
|
||||
}
|
||||
case GameChangeType.DESTROED:
|
||||
|
||||
Reference in New Issue
Block a user