Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parrot mode #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ dist/bundle.js

*.trace
yarn.lock
dist-server
Binary file added dist/assets/audio/parrot.mp3
Binary file not shown.
Binary file added dist/assets/parrot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 9 additions & 2 deletions src/client/SpaaaceClientEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion src/client/SpaaaceRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down