Some asteroids rotate in opposite direction

This commit is contained in:
KGrzeg 2021-10-16 02:58:13 +02:00
parent 65b99a20d8
commit 80f5d502c3

View file

@ -22,6 +22,9 @@ export default class Asteroid extends Phaser.Physics.Arcade.Sprite {
scene.physics.add.existing(this)
this.anims.play(Asteroid.getRandomAnimationName())
if (Phaser.Math.RND.integer() % 2 == 0)
this.anims.reverse()
this.setCircle(30, 30, 30)
this.setScale(Phaser.Math.RND.realInRange(0.7, 1.3))
this.setVelocity(