diff --git a/.gitignore b/.gitignore index 68314ae..8a11660 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ dist/bundle.js *.trace yarn.lock +dist-server diff --git a/dist/assets/audio/parrot.mp3 b/dist/assets/audio/parrot.mp3 new file mode 100644 index 0000000..523087b Binary files /dev/null and b/dist/assets/audio/parrot.mp3 differ diff --git a/dist/assets/parrot.png b/dist/assets/parrot.png new file mode 100644 index 0000000..100438f Binary files /dev/null and b/dist/assets/parrot.png differ diff --git a/src/client/SpaaaceClientEngine.js b/src/client/SpaaaceClientEngine.js index b534579..f7be1b3 100644 --- a/src/client/SpaaaceClientEngine.js +++ b/src/client/SpaaaceClientEngine.js @@ -65,10 +65,17 @@ export default class SpaaaceClientEngine extends ClientEngine { // handle sounds this.sounds = { missileHit: new Howl({ src: [assetPathPrefix + 'assets/audio/193429__unfa__projectile-hit.mp3'] }), - fireMissile: new Howl({ src: [assetPathPrefix + 'assets/audio/248293__chocobaggy__weird-laser-gun.mp3'] }) + fireMissile: new Howl({ src: [assetPathPrefix + 'assets/audio/248293__chocobaggy__weird-laser-gun.mp3'] }), + parrot: new Howl({ src: [assetPathPrefix + 'assets/audio/parrot.mp3'] }) }; - this.gameEngine.on('fireMissile', () => { this.sounds.fireMissile.play(); }); + this.gameEngine.on('fireMissile', () => { + if (this.renderer.playerShip.actor.shipSprite._texture.textureCacheIds[0] == 'shipparrot') { + this.sounds.parrot.play(); + } else { + this.sounds.fireMissile.play(); + } + }); this.gameEngine.on('missileHit', () => { // don't play explosion sound if the player is not in game if (this.renderer.playerShip) { diff --git a/src/client/SpaaaceRenderer.js b/src/client/SpaaaceRenderer.js index c214964..a2ae737 100644 --- a/src/client/SpaaaceRenderer.js +++ b/src/client/SpaaaceRenderer.js @@ -15,10 +15,11 @@ export default class SpaaaceRenderer extends Renderer { ship2: 'assets/ship2.png', ship3: 'assets/ship3.png', ship4: 'assets/airplane.png', - ship5: 'assets/ship5.png', + ship5: 'assets/ship5.png', ship8: 'assets/ship8.png', shipn: 'assets/shipn.png', ship6: 'assets/ship6.png', + shipparrot: 'assets/parrot.png', missile: 'assets/shot.png', bg1: 'assets/space3.png', bg2: 'assets/space2.png',