Commit f1a44af0 authored by haiyoucuv's avatar haiyoucuv

蛇移动

parent 9d71d42a
......@@ -15,7 +15,6 @@ export class Game extends Container {
joystick: Joystick = null;
private snake: Snake;
private mapCtn: Container;
private eleCtn: Container;
private elementMgr: ElementMgr;
......@@ -30,23 +29,18 @@ export class Game extends Container {
const bg = this.addChild(new Sprite());
Assets.load(bgImg).then((texture) => bg.texture = texture);
this.joystick = this.addChild(new Joystick());
this.joystick.visible = false;
this.eleCtn = this.addChild(new Container());
this.eleCtn.y = mapTop;
this.mapCtn = this.addChild(new Container());
this.mapCtn.y = mapTop;
this.elementMgr = new ElementMgr(this.mapCtn);
this.elementMgr.start();
this.snake = this.mapCtn.addChild(new Snake());
this.snake.init();
this.elementMgr = new ElementMgr(this.eleCtn);
this.elementMgr.start();
this.on("pointerdown", this.onPointerDown, this);
this.on("pointerup", this.onPointerUp, this);
}
......
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