diff --git a/src/act1.js b/src/act1.js index 0b46575..e467d42 100644 --- a/src/act1.js +++ b/src/act1.js @@ -4,7 +4,7 @@ var controlPanelSprite = kontra.sprite({x: 16, y: 13, width: 3, height: 2}); act1.init = function() { - if (kontra.store.get('current-room') === 'stasis_dark') { + if (muri.currentRoom === 'stasis_dark') { muri.get('bubble') .story([ [['Beep', 'Bip, Bip'], [20, 15]], @@ -18,8 +18,8 @@ if (muri.get('mouse').clickedOn(controlPanelSprite)) { muri.get('mouse').releaseClick(); - if (kontra.store.get('current-room') === 'stasis_dark') { - kontra.store.set('current-room', 'stasis'); + if (muri.currentRoom === 'stasis_dark') { + muri.currentRoom = 'stasis'; muri.get('bubble') .talk([ 'Ah, much better.', diff --git a/src/index_dev.html b/src/index_dev.html index 1aee059..5689dab 100644 --- a/src/index_dev.html +++ b/src/index_dev.html @@ -10,7 +10,6 @@
loading game ...
- diff --git a/src/mouse.js b/src/mouse.js index 77f3063..8329314 100644 --- a/src/mouse.js +++ b/src/mouse.js @@ -36,7 +36,7 @@ mouse.enable = function() { isEnabled = true; - canvas.style.cursor = 'hand'; + canvas.style.cursor = 'pointer'; }; mouse.name = 'mouse'; diff --git a/src/muri.js b/src/muri.js index 655d461..e6a9281 100644 --- a/src/muri.js +++ b/src/muri.js @@ -51,6 +51,7 @@ var muri = (function() { image: kontra.assets.images['room_'+room] }); }; + muri.currentRoom = 'stasis_dark'; muri.modules = []; muri.get = function(moduleName) { for (var i in muri.modules) @@ -58,22 +59,12 @@ var muri = (function() { return muri.modules[i]; }; - muri.newGame = function() { - kontra.store.set('current-room', 'stasis_dark'); - muri.modules.forEach(function(m) { - if (m.init !== undefined) m.init(); - }); - }; - muri.setup = function() { kontra.assets.load( - 'player.png', 'room_stasis_dark.gif', 'room_stasis.gif' ).then(function() { document.getElementById('loading').style.display = 'none'; - if (kontra.store.get('current-room') === null) - kontra.store.set('current-room', 'stasis'); var rooms = { stasis_dark: bg('stasis_dark'), stasis: bg('stasis') @@ -81,29 +72,26 @@ var muri = (function() { kontra.gameLoop({ update: function() { - var currentRoom = kontra.store.get('current-room'); - rooms[currentRoom].update(); + rooms[muri.currentRoom].update(); muri.modules.forEach(function(m) { if (m.update !== undefined) m.update(); }); }, render: function() { - var currentRoom = kontra.store.get('current-room'); - rooms[currentRoom].render(); + rooms[muri.currentRoom].render(); muri.modules.forEach(function(m) { if (m.render !== undefined) m.render(); }); } }).start(); - }); - muri.newGame(); + muri.modules.forEach(function(m) { + if (m.init !== undefined) m.init(); + }); + }); }; return muri; }()); -document - .getElementById('newGame') - .addEventListener('click', muri.newGame); window.onload = muri.setup;