Преглед изворни кода

Fixed the audio base url to make sense. Made some logs into errors

tags/v0.1.0
Fen Dweller пре 7 година
родитељ
комит
04200ad0f6
No known key found for this signature in database GPG Key ID: E80B35A6F11C3656
1 измењених фајлова са 4 додато и 4 уклоњено
  1. +4
    -4
      audio.js

+ 4
- 4
audio.js Прегледај датотеку

@@ -1,7 +1,7 @@
let playing = []; let playing = [];
let looping = {}; let looping = {};


const audioBaseUrl = "https://chemicalcrux.org/satiate/media/audio/";
const audioBaseUrl = "/media/audio/";


let audioDict = {}; let audioDict = {};


@@ -9,7 +9,7 @@ let audioDict = {};


function playSfx(name) { function playSfx(name) {
if (audioDict[name] == undefined) { if (audioDict[name] == undefined) {
console.log(name + " is not loaded yet, dingus");
console.error(name + " is not loaded yet, dingus");
return; return;
} }


@@ -27,13 +27,13 @@ function playSfx(name) {


function playLoop(name) { function playLoop(name) {
if (audioDict[name] == undefined) { if (audioDict[name] == undefined) {
console.log(name + " is not loaded yet, dingus");
console.error(name + " is not loaded yet, dingus");
return; return;
} }


// if already playing, just keep going // if already playing, just keep going
if (looping[name] && !looping[name].done) { if (looping[name] && !looping[name].done) {
console.log(name + " is already looping");
console.warn(name + " is already looping");
return; return;
} }




Loading…
Откажи
Сачувај