【发布时间】:2021-12-25 03:53:55
【问题描述】:
我只想每 x 秒放一颗炸弹
Bomb extends Phaser.Physics.Arcade.Group {
constructor(physicsWorld, scene) {
super(physicsWorld, scene)
}
newBomb(x, y){
let bomb = this.create(x, y, 'bomb')
if(bomb){
bomb.setActive(true)
bomb.setVisible(true)
bomb.setImmovable(true)
bomb.setOrigin(0)
setTimeout(()=> {
bomb.disableBody(true, true)
console.log('BOOM!')
}, 3000)
}
}
该出版物告诉我,我必须写更多,否则我将无法发布此消息 -.- 我唯一想要的就是每 x 分钟放一个炸弹,直到它爆炸
【问题讨论】:
-
我的回答是否解决了您的问题,还是您需要更多帮助?
标签: phaser-framework