From 4f080419de875742feedfbf124f979b0a8675f01 Mon Sep 17 00:00:00 2001 From: Tim Repke Date: Sun, 18 Oct 2015 00:49:35 +0200 Subject: [PATCH] fixed #14, where char isnt forced to update to get armour --- .../view/signups/game1/js/character.js | 17 ++++++++++------- .../view/signups/game1/js/story.js | 2 +- registration-system/view/signups/game1/ui.css | 2 +- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/registration-system/view/signups/game1/js/character.js b/registration-system/view/signups/game1/js/character.js index c44392d..f9f3379 100644 --- a/registration-system/view/signups/game1/js/character.js +++ b/registration-system/view/signups/game1/js/character.js @@ -60,12 +60,15 @@ Char.prototype.initializeAnimations = function() { }); }; Char.directionToName = ["UP", "RIGHT", "DOWN", "LEFT"]; -Char.prototype.animate = function() { - this.animateStep += 1; - if (this.animateStep <= 8) return; - while (this.animateStep > 8) - this.animateStep -= 8; - +Char.prototype.animate = function(force) { + if(force) { + this.animateStep = 0; + } else { + this.animateStep += 1; + if (this.animateStep <= 8) return; + while (this.animateStep > 8) + this.animateStep -= 8; + } var xSpeed = this.translation[0] - this.lastPosition[0]; var ySpeed = - this.translation[1] + this.lastPosition[1]; this.lastPosition = this.translation.slice(); @@ -91,7 +94,7 @@ Char.prototype.animate = function() { lastFrame.style.display = 'none'; } // change animation - if (direction != this.lastDirection) { + if (direction != this.lastDirection || force) { this.lastDirection = direction; this.currentFrame = 0; this.frames = this.animations[Char.directionToName[direction]+postfix]; diff --git a/registration-system/view/signups/game1/js/story.js b/registration-system/view/signups/game1/js/story.js index c0a10f1..837fe22 100644 --- a/registration-system/view/signups/game1/js/story.js +++ b/registration-system/view/signups/game1/js/story.js @@ -194,7 +194,7 @@ Story.actions = { condition: Environment.progress.inventory_money, action: function () { Environment.progress.inventory_ruestung = true; - if (Game.char) Game.char.animate(); // apply new visuals + if (Game.char) Game.char.animate(true); // apply new visuals } }, { message: 'Was? Spende? Ich hab\' nichts!', diff --git a/registration-system/view/signups/game1/ui.css b/registration-system/view/signups/game1/ui.css index 3de8775..16feb6b 100644 --- a/registration-system/view/signups/game1/ui.css +++ b/registration-system/view/signups/game1/ui.css @@ -41,7 +41,7 @@ } #game-overlay.loading { - background: #000 url('graphics/loader.svg') no-repeat 300px 200px !important; + background: #000 url('graphics/loader.gif') no-repeat 300px 200px !important; display: block !important; }