diff --git a/registration-system/view/signups/game1/index.php b/registration-system/view/signups/game1/index.php index c395d26b62f1fefd62581398a949033fdc2e5bd0..3b78ca4c7401525636da2f1182c7c7bab208930c 100644 --- a/registration-system/view/signups/game1/index.php +++ b/registration-system/view/signups/game1/index.php @@ -21,7 +21,7 @@ class Game1SignupMethod extends SignupMethod { public function getJSDependencies() { return ['../../js/jquery-1.11.1.min.js', 'jslib/d3.min.js', 'jslib/priority-queue.min.js', 'jslib/checkLineIntersection.js', 'js/events.js','js/achievements.js', 'js/svgUtils.js', 'js/pathFinder.js', 'js/vector.js', 'js/character.js','js/camera.js', - 'js/game.js']; + 'js/environment.js', 'js/game.js']; } public function getCSSDependencies() { diff --git a/registration-system/view/signups/game1/js/achievements.js b/registration-system/view/signups/game1/js/achievements.js index 6ed22f4331ba98791f0c8ab818a8c4a0a7d4a914..11deca91de7d6093f45ccab66c49d8e249ccadc3 100644 --- a/registration-system/view/signups/game1/js/achievements.js +++ b/registration-system/view/signups/game1/js/achievements.js @@ -9,6 +9,7 @@ function Achievements() { } }, 'saw_devs1': 'Wilde Informatiker auf Wiese gesehen', + 'moneyboy': 'Money Boy: Swag ist aufgedreht', // TODO: add more! 'achievement42': 'You just found the answer to everything!' }; diff --git a/registration-system/view/signups/game1/js/environment.js b/registration-system/view/signups/game1/js/environment.js new file mode 100644 index 0000000000000000000000000000000000000000..84fe22acae3e602fd7e16954c70821665617341d --- /dev/null +++ b/registration-system/view/signups/game1/js/environment.js @@ -0,0 +1,51 @@ +function Environment () { + // something? +} + +Environment.prototype.progress = { + fs_firstApproach: false, + fs_georgeScreamed: false, + fs_filledBoard: false, + killedGoat: false +}; + +Environment.prototype.inventory = { + money: false, + goatDrops: false +}; + +Environment.prototype.mapEvents = { + 'map_landing': { + init: function(svg) { + if (this.progress.fs_filledBoard) { + // TODO: remove baustelle (that doesn't exist yet) + } else { + var ship = svg.select("#shipGroup"); + ship + .attr("transform", function (d, i) { + return "translate(200,000)"; + }); + ship.transition() + .duration(3000) + .attr("transform", function (d, i) { + return "translate(0,0)"; + }); + } + } + }, + 'castle_entrance': { + init: function(svg) { + + } + }, + 'castle_fs': { + init: function(svg) { + + } + }, + 'dorf': { + init: function(svg) { + + } + } +}; \ No newline at end of file diff --git a/registration-system/view/signups/game1/js/game.js b/registration-system/view/signups/game1/js/game.js index 5365b5fad4389b3dbef6df066df2aa54149c0b41..753a937c53fd7f70afa31067d66a258d718c7a8c 100644 --- a/registration-system/view/signups/game1/js/game.js +++ b/registration-system/view/signups/game1/js/game.js @@ -5,6 +5,7 @@ function Game(config) { Game.instance = this; Game.achievements = new Achievements(); + Game.environment = new Environment(); Game.eventHandler = null; Game.char = null; Game.cam = null; @@ -72,18 +73,13 @@ Game.prototype.loadMap = function(map, spawn) { Game.eventHandler = new EventHandler(svg); // ------------------------------------- + // init map specific things + Game.environment.mapEvents[mapId].init(svg); + // init view stuff Game.char = new Char(svg, {spawnid: spawn}); Game.cam = new Camera(svg, Game.char.translation); - - // test animation - /*var ship = svg.select("#shipGroup"); - ship - .attr("transform", function(d,i) { return "translate(200,000)"; }); - ship.transition() - .duration(3000) - .attr("transform", function(d,i) { return "translate(0,0)"; });*/ done(); }); diff --git a/registration-system/view/signups/game1/test.html b/registration-system/view/signups/game1/test.html index f413f70007de386e73e7ed260b5759e818b259ed..291b9bf45767c34245041f2127734f0a2385bec3 100644 --- a/registration-system/view/signups/game1/test.html +++ b/registration-system/view/signups/game1/test.html @@ -15,6 +15,7 @@ <script src="js/vector.js" type="text/javascript"></script> <script src="js/character.js" type="text/javascript"></script> <script src="js/camera.js" type="text/javascript"></script> + <script src="js/environment.js" type="text/javascript"></script> <script src="js/game.js" type="text/javascript"></script> </head> <body>