We have audio! Thanks @orsi!

This commit is contained in:
jorsi
2020-05-28 19:10:09 -04:00
committed by Michael Townsend
parent d6d1c1b987
commit a601473645
106 changed files with 1415 additions and 399 deletions
+8 -1
View File
@@ -1,5 +1,4 @@
var World = {
RADIUS: 30,
VILLAGE_POS: [30, 30],
TILE: {
@@ -347,6 +346,11 @@ var World = {
World.lightMap(World.curPos[0], World.curPos[1], World.state.mask);
World.drawMap();
World.doSpace();
// play random footstep
var randomFootstep = Math.floor(Math.random() * 5) + 1;
AudioEngine.playSound(AudioLibrary['FOOTSTEPS_' + randomFootstep]);
if(World.checkDanger()) {
if(World.danger) {
Notifications.notify(World, _('dangerous to be this far from the village without proper protection'));
@@ -534,6 +538,7 @@ var World = {
} else if(typeof World.LANDMARKS[curTile] != 'undefined') {
if(curTile != World.TILE.OUTPOST || !World.outpostUsed()) {
Events.startEvent(Events.Setpieces[World.LANDMARKS[curTile].scene]);
AudioEngine.playEventMusic(Events.Setpieces[World.LANDMARKS[curTile].scene].audio);
}
} else {
if(World.useSupplies()) {
@@ -883,6 +888,7 @@ var World = {
World.state = null;
Path.outfit = {};
$SM.remove('outfit');
AudioEngine.playSound(AudioLibrary.DEATH);
$('#outerSlider').animate({opacity: '0'}, 600, 'linear', function() {
$('#outerSlider').css('left', '0px');
$('#locationSlider').css('left', '0px');
@@ -1006,6 +1012,7 @@ var World = {
World.curPos = World.copyPos(World.VILLAGE_POS);
World.drawMap();
World.setTitle();
AudioEngine.playBackgroundMusic(AudioLibrary.MUSIC_WORLD);
World.dead = false;
$('div#bagspace-world > div').empty();
World.updateSupplies();