【发布时间】:2016-05-04 22:55:19
【问题描述】:
大家好,我现在正在构建我的游戏,并试图让一些文本在几秒钟后消失。我正在使用 Phaser,但我不确定如何执行此操作。
目前我有:
Asteroid.time.events.remove(Phaser.Timer.SECOND - 3, this.startInstructions3, this);
我的文字正常显示在页面上:
if (!this.rockmodel.countLiving()) {
Asteroid.time.events.add(Phaser.Timer.SECOND * 3, this.levelIncrease, this);
var startInstructions3 = 'NEXT LEVEL! ';
this.gametext3 = Asteroid.add.text(Asteroid.world.centerX, Asteroid.world.centerY, startInstructions3, lifefont3.thefont3);
this.gametext3.align = 'center';
this.gametext3.anchor.set(0.5, 0.5);
}
然后当我回到我的levelIncrease 函数时,我有:
if (this.rockcount < rocksincoming.max) {
this.rockcount += rocksincoming.astup;
}
Asteroid.time.events.remove(Phaser.Timer.SECOND * 3, this.startInstructions3, this);
this.randomrock();
},
endofgame: function () {
Asteroid.state.start(gameobjectstouse.menu);
},
我的问题是,它是像 -3 还是你可以在 Phaser 中做一些固定的事情,比如持续时间或类似的东西?我似乎找不到任何关于它的信息。
谢谢。
【问题讨论】:
标签: javascript phaser-framework