softer failure sound for ui/learn
parent
0adb337a9d
commit
fa5428f137
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -39,10 +39,6 @@ module.exports = function(blueprint, opts) {
|
|||
// cheat
|
||||
Mousetrap.bind(['shift+enter'], complete);
|
||||
|
||||
var failSoundOnce = function() {
|
||||
sound.once('failure', opts.stage.key + '/' + blueprint.id);
|
||||
};
|
||||
|
||||
var assertData = function() {
|
||||
return {
|
||||
scenario: scenario,
|
||||
|
@ -53,7 +49,7 @@ module.exports = function(blueprint, opts) {
|
|||
|
||||
var detectFailure = function() {
|
||||
var failed = blueprint.failure && blueprint.failure(assertData());
|
||||
if (failed) failSoundOnce();
|
||||
if (failed) sound.failure();
|
||||
return failed;
|
||||
};
|
||||
|
||||
|
@ -70,7 +66,7 @@ module.exports = function(blueprint, opts) {
|
|||
vm.failed = true;
|
||||
ground.stop();
|
||||
ground.showCapture(move);
|
||||
failSoundOnce();
|
||||
sound.failure();
|
||||
return true;
|
||||
};
|
||||
|
||||
|
@ -81,7 +77,7 @@ module.exports = function(blueprint, opts) {
|
|||
else { // moving into check
|
||||
vm.failed = true;
|
||||
ground.showCheckmate(chess);
|
||||
failSoundOnce();
|
||||
sound.failure();
|
||||
return m.redraw();
|
||||
}
|
||||
var took = false,
|
||||
|
|
|
@ -15,8 +15,7 @@ var make = function(file, volume) {
|
|||
};
|
||||
};
|
||||
|
||||
|
||||
var sounds = {
|
||||
module.exports = {
|
||||
move: make('standard/Move'),
|
||||
take: make('sfx/Tournament3rd', 0.4),
|
||||
levelStart: make('other/ping'),
|
||||
|
@ -24,16 +23,5 @@ var sounds = {
|
|||
stageStart: make('other/guitar'),
|
||||
// stageEnd: make('sfx/Tournament1st'),
|
||||
stageEnd: make('other/gewonnen'),
|
||||
failure: make('other/failure')
|
||||
failure: make('other/no-go')
|
||||
};
|
||||
|
||||
var onces = [];
|
||||
sounds.once = function(sound, id) {
|
||||
var key = id + '/' + sound;
|
||||
if (onces.indexOf(key) === -1) {
|
||||
sounds[sound]();
|
||||
onces.push(key);
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = sounds;
|
||||
|
|
Loading…
Reference in New Issue