update
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -82,6 +82,6 @@ class Render extends SpriteView implements IRender {
|
|||||||
90;
|
90;
|
||||||
} else {
|
} else {
|
||||||
0;
|
0;
|
||||||
}) / (Math.PI * 2);
|
}) * (Math.PI / 180);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|||||||
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user