Commit 69ead5e9 authored by haiyoucuv's avatar haiyoucuv

init

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