mirror of
https://github.com/doublespeakgames/adarkroom.git
synced 2026-05-29 00:31:53 +08:00
remove logging
This commit is contained in:
+1
-15
@@ -18,8 +18,6 @@ var AudioEngine = {
|
||||
init: function (options) {
|
||||
// for legacy browsers
|
||||
AudioEngine.audioContext = new (window.AudioContext || window.webkitAudioContext);
|
||||
audioLog('starting audio engine');
|
||||
console.log(AudioEngine.audioContext);
|
||||
|
||||
if (AudioEngine.audioContext.state === 'suspended') {
|
||||
AudioEngine.audioContext.resume().then(function () {
|
||||
@@ -52,7 +50,6 @@ var AudioEngine = {
|
||||
options: {}, // Nothing for now,
|
||||
_canPlayAudio: function () {
|
||||
if (AudioEngine.audioContext.state === 'suspended') {
|
||||
audioLog('can\'t play audio');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -68,9 +65,6 @@ var AudioEngine = {
|
||||
_fadeTrack: function (buffer) {
|
||||
if (!AudioEngine._canPlayAudio()) return;
|
||||
|
||||
audioLog('_fadeMusic');
|
||||
console.log(buffer);
|
||||
|
||||
var bufferSource = AudioEngine.audioContext.createBufferSource();
|
||||
bufferSource.buffer = buffer;
|
||||
bufferSource.loop = true;
|
||||
@@ -138,25 +132,21 @@ var AudioEngine = {
|
||||
changeMusic: function (src) {
|
||||
AudioEngine.loadAudioFile(src)
|
||||
.then(function (buffer) {
|
||||
audioLog('changeMusic: ' + src);
|
||||
AudioEngine._fadeTrack(buffer);
|
||||
});
|
||||
},
|
||||
playEventMusic: function (src) {
|
||||
AudioEngine.loadAudioFile(src)
|
||||
.then(function (buffer) {
|
||||
audioLog('playEventMusic: ' + src);
|
||||
AudioEngine._playEvent(buffer);
|
||||
});
|
||||
},
|
||||
stopEventMusic: function () {
|
||||
audioLog('stopEventMusic');
|
||||
AudioEngine._stopEventMusic();
|
||||
},
|
||||
playSound: function (src) {
|
||||
AudioEngine.loadAudioFile(src)
|
||||
.then(function (buffer) {
|
||||
audioLog('playSound: ' + src);
|
||||
AudioEngine._playSound(buffer);
|
||||
});
|
||||
},
|
||||
@@ -197,8 +187,4 @@ var AudioEngine = {
|
||||
AudioEngine.audioContext.currentTime + AudioEngine.FADE_TIME / 2
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
function audioLog(message) {
|
||||
console.log('%c' + message, 'background: #222; color: #bada55');
|
||||
}
|
||||
};
|
||||
@@ -362,8 +362,6 @@ var Events = {
|
||||
},
|
||||
|
||||
useWeapon: function(btn) {
|
||||
console.log('%cuse weapon: ', 'background: #222; color: #bada55');
|
||||
console.log(btn);
|
||||
if(Events.activeEvent()) {
|
||||
var weaponName = btn.attr('id').substring(7).replace('-', ' ');
|
||||
var weapon = World.Weapons[weaponName];
|
||||
@@ -1041,7 +1039,6 @@ var Events = {
|
||||
} else {
|
||||
var r = Math.floor(Math.random()*(possibleEvents.length));
|
||||
Events.startEvent(possibleEvents[r]);
|
||||
console.log('event', possibleEvents[r].audio);
|
||||
AudioEngine.playSound(Events.SOUNDS['trigger-event']);
|
||||
AudioEngine.playEventMusic(possibleEvents[r].audio);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user