Asteroids appears
This commit is contained in:
parent
23c6ce2a7e
commit
8c6ae46884
1 changed files with 11 additions and 0 deletions
|
|
@ -36,6 +36,17 @@ export default class Asteroid extends Phaser.Physics.Arcade.Sprite {
|
|||
this.anims.timeScale = 1 + (this.scaleMax - this.scale) * this.scaleRotationFactor
|
||||
if (Phaser.Math.RND.integer() % 2 == 0)
|
||||
this.anims.reverse()
|
||||
|
||||
this.setAlpha(0)
|
||||
scene.tweens.addCounter({
|
||||
from: 0,
|
||||
to: 1,
|
||||
duration: Asteroid.unbornAge,
|
||||
onUpdate: (tween) => {
|
||||
const value = tween.getValue()
|
||||
this.setAlpha(value)
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
preUpdate(time: number, delta: number) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue