Switch to Howler for audio

This commit is contained in:
asraelite 2018-03-07 12:21:43 +00:00
parent 3eb74e44aa
commit 194c0bf846
13 changed files with 78 additions and 19 deletions

View file

@ -2,6 +2,7 @@ import * as input from '../input.mjs';
import * as events from './events.mjs';
import * as graphics from '../graphics/index.mjs';
import * as inventory from './inventory.mjs';
import * as audio from './audio.mjs';
import {playerShip} from '../world/index.mjs';
import {state} from './index.mjs';
@ -38,6 +39,12 @@ export function tick() {
function tickPlaying() {
if (held[mapping.thrust]) {
playerShip.applyThrust({ forward: 1 });
} else {
audio.stop('engine');
}
if (pressed[mapping.thrust]) {
audio.start('engine');
}
if (held[mapping.left]) {