GitLab system status is available here and here

Commit 86668b7d authored by Ankie Pon's avatar Ankie Pon
Browse files

added firing sound effect

parent 95a6a6d3
......@@ -7,6 +7,8 @@ class Rocket extends Phaser.GameObjects.Sprite {
scene.add.existing(this);
this.isFiring = false;
this.moveSpeed = 2;
this.sfxRocket = scene.sound.add('sfx_rocket'); // add rocket sfx
}
update() {
......@@ -20,8 +22,9 @@ class Rocket extends Phaser.GameObjects.Sprite {
}
}
//fire button
if(Phaser.Input.Keyboard.JustDown(keyF)) {
if(Phaser.Input.Keyboard.JustDown(keyF) && !this.isFiring) {
this.isFiring = true;
this.sfxRocket.play(); // play sfx
}
//if fired move up
if(this.isFiring && this.y >= borderUISize * 3 + borderPadding) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment