Skip to content
Snippets Groups Projects
Commit 394a86bd authored by Tim Repke's avatar Tim Repke
Browse files

fixed errors on mapchange

parent d122f592
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ function Game(config) { ...@@ -2,6 +2,7 @@ function Game(config) {
if (!(this instanceof Game)) throw "'Game' needs to be constructed"; if (!(this instanceof Game)) throw "'Game' needs to be constructed";
if (Game.instance) throw "'Game' already constructed"; if (Game.instance) throw "'Game' already constructed";
Game.config = config; Game.config = config;
Game.config.loopSpeed = 10;
Game.instance = this; Game.instance = this;
Game.achievements = new Achievements(); Game.achievements = new Achievements();
...@@ -20,13 +21,16 @@ Game.prototype.run = function () { ...@@ -20,13 +21,16 @@ Game.prototype.run = function () {
Game.prototype.nextMap = function (map, spawn) { Game.prototype.nextMap = function (map, spawn) {
clearInterval(Game.mainLoop); clearInterval(Game.mainLoop);
Game.mainLoop = null; Game.mainLoop = null;
var gameRoot = document.getElementById("gameRoot"); var self = this;
while (gameRoot.firstChild) { setTimeout(function() {
gameRoot.removeChild(gameRoot.firstChild); var gameRoot = document.getElementById("gameRoot");
} while (gameRoot.firstChild) {
Game.char = null; gameRoot.removeChild(gameRoot.firstChild);
Game.cam = null; }
this.loadMap(map, spawn); Game.char = null;
Game.cam = null;
self.loadMap(map, spawn);
}, Game.config.loopSpeed+5);
}; };
Game.prototype.loadMap = function (map, spawn) { Game.prototype.loadMap = function (map, spawn) {
...@@ -126,7 +130,7 @@ Game.prototype.loadMap = function (map, spawn) { ...@@ -126,7 +130,7 @@ Game.prototype.loadMap = function (map, spawn) {
// cam movement // cam movement
Game.cam.movement(); Game.cam.movement();
} }
}, 10); }, Game.config.loopSpeed);
} }
......
...@@ -90,6 +90,7 @@ Story.actions = { ...@@ -90,6 +90,7 @@ Story.actions = {
&& Environment.progress.fs_firstApproach && Environment.progress.inventory_money; && Environment.progress.fs_firstApproach && Environment.progress.inventory_money;
}, },
action: function () { action: function () {
Story.actions.fs_exit_hint.state.hintGiven = true;
Story.dialogueHelper([ Story.dialogueHelper([
{ {
bubble: '#tim_speech', bubble: '#tim_speech',
...@@ -105,6 +106,7 @@ Story.actions = { ...@@ -105,6 +106,7 @@ Story.actions = {
}, },
action: function () { action: function () {
console.log('fuck yeah!'); console.log('fuck yeah!');
Environment.progress.fs_filledBoard = true;
Game.log('Kontaktdaten verloren.'); Game.log('Kontaktdaten verloren.');
Game.log('Lieber schnell wieder raus hier!'); Game.log('Lieber schnell wieder raus hier!');
// TODO implement board fill // TODO implement board fill
......
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment