Commit 7bcf7521 authored by Tt's avatar Tt

bugchuli

parent 295340c7
......@@ -16,6 +16,9 @@ export default class NewClass extends cc.Component {
private txt: cc.Node;
private right: cc.Node;
private img: cc.Node;
private robotScore: number;
private playerScore: number;
onLoad() {
this.mask = pg.view.find(this, "mask");
this.penguin = pg.view.find(this.mask, "penguin");
......@@ -29,6 +32,8 @@ export default class NewClass extends cc.Component {
this.img = pg.view.find(this.panel_text, "img");
let btn_touch = pg.view.find(this, "btn_touch");
pg.view.touchOn(btn_touch, this.onPlayerText, this);
this.robotScore = Game.getIns().robotScore
this.playerScore = Game.getIns().playerScore;
}
private data: any;
......@@ -81,6 +86,8 @@ export default class NewClass extends cc.Component {
this.scheduleOnce(() => {
if (this.touched) return;
if (Game.getIns().pause) return;
if (this.robotScore != Game.getIns().robotScore) return;
if (this.playerScore != Game.getIns().playerScore) return;
Game.getIns().isRobot = true;
this.onTouchText();
}, time);
......
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