Commit 942afd4d by Shawn Wang

fix

parent b35a62d8
...@@ -62,18 +62,18 @@ class Controller extends egret.Sprite { ...@@ -62,18 +62,18 @@ class Controller extends egret.Sprite {
controlContainer.addChild(this.down) controlContainer.addChild(this.down)
controlContainer.addChild(this.left) controlContainer.addChild(this.left)
controlContainer.addChild(this.right) controlContainer.addChild(this.right)
}
const me = Store.getState().runners.find(runner => runner.t_cid === Store.getState().cid) const me = Store.getState().runners.find(runner => runner.t_cid === Store.getState().cid)
this.myPosition.x = me.x this.myPosition.x = me.x
this.myPosition.y = me.y this.myPosition.y = me.y
EventBus.addEventListener('moving', (payload) => { EventBus.addEventListener('moving', (payload) => {
if (payload.target.payload.t_cid === Store.getState().cid) { if (payload.target.payload.t_cid === Store.getState().cid) {
this.myPosition.x = payload.target.payload.x this.myPosition.x = payload.target.payload.x
this.myPosition.y = payload.target.payload.y this.myPosition.y = payload.target.payload.y
} }
}) })
}
} }
private controlTouchBegin(e: egret.TouchEvent){ private controlTouchBegin(e: egret.TouchEvent){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment