diff --git a/registration-system/view/signups/game1/game.js b/registration-system/view/signups/game1/game.js deleted file mode 100644 index 6d0a734fba0542f0bd4ffecfe7cbee364095a697..0000000000000000000000000000000000000000 --- a/registration-system/view/signups/game1/game.js +++ /dev/null @@ -1,20 +0,0 @@ - -/* -Small hints: -------------- - - -var FAPI = new FAPI(); - -later add data as they come in: -FAPI.data.setValue('mehl', 'bla@lala.de'); - -and send: -FAPI.submitSignup(); - - -place global in a load_game() function (or so) and call it in game1/index.php as already implemented there. - -to avoid broken paths, use as follows: -d3.xml(FAPI.resolvePath('graphics/map_castle.svg'), 'image/svg+xml', function (xml) { -*/ \ No newline at end of file diff --git a/registration-system/view/signups/game1/js/achievements.js b/registration-system/view/signups/game1/js/achievements.js index 575641d9bd793cbccb8f48165b7c226917fed832..9251f1d2534f6fdedc14b7b9319d44958eb77572 100644 --- a/registration-system/view/signups/game1/js/achievements.js +++ b/registration-system/view/signups/game1/js/achievements.js @@ -55,7 +55,7 @@ Achievements.prototype.updateStatusText = function () { }; Achievements.prototype.logMessage = function (message) { - if (Environment.sound.achievements) new Audio(FAPI.resolvePath('sounds/ding.mp3')).play(); + if (Environment.sound.achievements) new Audio(FAPI.resolvePath('sounds/ding.ogg')).play(); var list = this.getDomElem('log'); var newElem = document.createElement('li'); @@ -98,4 +98,4 @@ Achievements.prototype.triggerAchievement = function (achievementId, context) { // else console.warn("Achievement already achieved: " + achievementId); if (this.numCompletedAchievements() === 42 ) this.triggerAchievement('achievement42') -}; \ No newline at end of file +}; diff --git a/registration-system/view/signups/game1/js/character.js b/registration-system/view/signups/game1/js/character.js index b2b05d64eeb43f936e188407866bc3e6fb7fe345..3fea7146f2b2dd612ed27048a2ee03a18ba53ae6 100644 --- a/registration-system/view/signups/game1/js/character.js +++ b/registration-system/view/signups/game1/js/character.js @@ -118,7 +118,7 @@ Char.prototype.animate = function() { Char.prototype.physics = function() { if (!this.moveTarget || this.moveTarget && this.moveTarget.length == 0) { if (this.onArrivalCallback && typeof this.onArrivalCallback.func === 'function') - this.onArrivalCallback.func(this.onArrivalCallback.param); + this.onArrivalCallback.func.apply(null, this.onArrivalCallback.params); this.onArrivalCallback = null; return; } @@ -163,11 +163,11 @@ Char.prototype.updatePosition = function() { * @param y coord * @param onArrival optional callback function */ -Char.prototype.setMoveTarget = function(x, y, onArrival, onArrivalParam) { +Char.prototype.setMoveTarget = function(x, y, onArrival, onArrivalParams) { this.onArrivalCallback = { func: onArrival, - param: onArrivalParam + params: onArrivalParams }; if (Game.config.usePathFinding) diff --git a/registration-system/view/signups/game1/js/events.js b/registration-system/view/signups/game1/js/events.js index 7f3190a43e6ddca722204ff0d752655884eca529..5f63127b788a1ac40bf19898613fc7a826a3caa6 100644 --- a/registration-system/view/signups/game1/js/events.js +++ b/registration-system/view/signups/game1/js/events.js @@ -49,7 +49,7 @@ EventHandler.prototype.getEventOn = function (trigger, x, y, callback) { this.walkOnEvents[node.id] = true; callback(node, true); } else { - callback(node); + callback(node, null); } } else { if (trigger == 'walkon' && this.walkOnEvents[node.id]) { @@ -94,7 +94,7 @@ EventHandler.prototype.handleEvent = function (event, context) { Game.instance.nextMap(event.destination, event.target); break; case 'special': - eventWasActive = EventHandler.handleAction(event); + eventWasActive = EventHandler.handleAction(event, context); break; } @@ -103,7 +103,7 @@ EventHandler.prototype.handleEvent = function (event, context) { } }; -EventHandler.handleAction = function (event) { +EventHandler.handleAction = function (event, context) { var isPossible = Story.actions[event.action].possible(); // check, whether action exists and is allowed at this point if (event.action && event.action in Story.actions && isPossible) { @@ -115,18 +115,18 @@ EventHandler.handleAction = function (event) { var xy = Vec.add(getTranslation(spawn[0][0], Game.char.svg[0][0]), [bbox.x, bbox.y]); // trigger action, then walk to target if (event.directAction && event.directAction === 'true') { - Story.actions[event.action].action(event); + Story.actions[event.action].action(event, context); Game.char.setMoveTarget(xy[0], xy[1]); } // walk to the action point, start action on callback else { - Game.char.setMoveTarget(xy[0], xy[1], Story.actions[event.action].action, event); + Game.char.setMoveTarget(xy[0], xy[1], Story.actions[event.action].action, [event, context]); } } } // otherwise start action directly else { - Story.actions[event.action].action(event); + Story.actions[event.action].action(event, context); } } return isPossible; diff --git a/registration-system/view/signups/game1/js/game.js b/registration-system/view/signups/game1/js/game.js index 44c96d01c49021c3f3f9711afd9579f3a88f7016..0d1020703a2e51bf44c1f571e254b2fa5d0aeaba 100644 --- a/registration-system/view/signups/game1/js/game.js +++ b/registration-system/view/signups/game1/js/game.js @@ -184,7 +184,7 @@ Game.prototype.loadMap = function (map, spawn) { }; Game.log = function (message) { - if (Environment.sound.log) new Audio(FAPI.resolvePath('sounds/plop.mp3')).play(); + if (Environment.sound.log) new Audio(FAPI.resolvePath('sounds/plop.ogg')).play(); var list = document.getElementById('game-log'); var newElem = document.createElement('li'); diff --git a/registration-system/view/signups/game1/js/story.js b/registration-system/view/signups/game1/js/story.js index c18d0b14b81f2bd5be5591b22325ed203af98343..8c0e1b91b8b7ad1ef680a71f03ea22b4c7d85818 100644 --- a/registration-system/view/signups/game1/js/story.js +++ b/registration-system/view/signups/game1/js/story.js @@ -7,6 +7,38 @@ Story.actions = { // ================================================================================================================= // Actions in the Fachschaft room + 'castlee_door': { + state: { + doorInitialPos: {} + }, + possible: function() { return true; }, + action: function(event, context) { + if (context.bEnter === null) return; + + var state = Story.actions.castlee_door.state; + var doorLeftId = '#' + event.id + '_l'; + var doorLeft = Game.char.svg.select(doorLeftId); + var doorRightId = '#' + event.id + '_r'; + var doorRight = Game.char.svg.select(doorRightId); + + if (state.doorInitialPos[doorLeftId] === void 0) + state.doorInitialPos[doorLeftId] = Number(doorLeft[0][0].getAttribute('x')); + if (state.doorInitialPos[doorRightId] === void 0) + state.doorInitialPos[doorRightId] = Number(doorRight[0][0].getAttribute('x')); + + var l = state.doorInitialPos[doorLeftId]; + var r = state.doorInitialPos[doorRightId]; + + var moveTo = context.bEnter ? 50 : 0; + + doorLeft.transition() + .duration(300) + .attr('x', l - moveTo); + doorRight.transition() + .duration(300) + .attr('x', r + moveTo); + } + }, 'fs_firstApproach': { state: { welcome_message: false, // welcome message spoken diff --git a/registration-system/view/signups/game1/maps/castle_entrance.svg b/registration-system/view/signups/game1/maps/castle_entrance.svg index fe44675e8888892d617c61e91927965fa2164151..1bbde223d4d04480e68aeb17de952a7109a76e43 100644 Binary files a/registration-system/view/signups/game1/maps/castle_entrance.svg and b/registration-system/view/signups/game1/maps/castle_entrance.svg differ diff --git a/registration-system/view/signups/game1/sounds/ding.mp3 b/registration-system/view/signups/game1/sounds/ding.mp3 deleted file mode 100644 index 4aa624b3fdaa63854390a5f0ace19cb987461246..0000000000000000000000000000000000000000 Binary files a/registration-system/view/signups/game1/sounds/ding.mp3 and /dev/null differ diff --git a/registration-system/view/signups/game1/sounds/ding.ogg b/registration-system/view/signups/game1/sounds/ding.ogg new file mode 100644 index 0000000000000000000000000000000000000000..4d84dbefe8132c27823ad24aa9add7c4569e37eb Binary files /dev/null and b/registration-system/view/signups/game1/sounds/ding.ogg differ diff --git a/registration-system/view/signups/game1/sounds/plop.mp3 b/registration-system/view/signups/game1/sounds/plop.mp3 deleted file mode 100644 index 28a62449d56d8122521f016b9cdb8e2d445a3cb0..0000000000000000000000000000000000000000 Binary files a/registration-system/view/signups/game1/sounds/plop.mp3 and /dev/null differ diff --git a/registration-system/view/signups/game1/sounds/plop.ogg b/registration-system/view/signups/game1/sounds/plop.ogg new file mode 100644 index 0000000000000000000000000000000000000000..464493b91fe354f528dfed14faba2b7349b8b225 Binary files /dev/null and b/registration-system/view/signups/game1/sounds/plop.ogg differ