Commit 69ead5e9 authored by haiyoucuv's avatar haiyoucuv

init

parent dd3dab31
...@@ -85,6 +85,12 @@ export class MainGame extends Scene { ...@@ -85,6 +85,12 @@ export class MainGame extends Scene {
this.uiBg.getComponent(UITransform) this.uiBg.getComponent(UITransform)
.setContentSize(Global.MAP_WIDTH, Global.MAP_HEIGHT); .setContentSize(Global.MAP_WIDTH, Global.MAP_HEIGHT);
// 注册事件
director.on(Events.showGOver, this.showGOver, this);
director.on(Events.setGameState, this.setGameState, this);
}
start() {
this.player.init({ this.player.init({
// initEnergy: 10000 // initEnergy: 10000
nickName: "我", nickName: "我",
...@@ -99,10 +105,6 @@ export class MainGame extends Scene { ...@@ -99,10 +105,6 @@ export class MainGame extends Scene {
// 设置游戏状态 // 设置游戏状态
this.setGameState(GameState.PLAY); this.setGameState(GameState.PLAY);
// 注册事件
director.on(Events.showGOver, this.showGOver, this);
director.on(Events.setGameState, this.setGameState, this);
} }
onDestroy() { onDestroy() {
......
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