New answers tagged

1

Nevermind, guys. I fixed the problem.. the reason why all the images are showing at the center of the screen is because of the "this.monsters = this.game.add.group();" and the " monster = state.monsters.create(state.game.world.centerX, state.game.world.centerY, data.image);" code. Now, the "x" serves as the horizontal position of the images and it should be ...


0

The easiest way is to use counters. If you want your bots to do something in X frames, you'll have: class Bot { constructor() { this.doSomethingCounter = 0; } doSomethingInFrames(n) { this.doSomethingCounter = n; } update() { if (this.doSomethingCounter > 0) { this.doSomethingCounter--; if (this.doSomethingCounter === ...



Top 50 recent answers are included