123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>Impact Game</title>
- <style type="text/css">
- html,body {
- background-color: #333;
- color: #fff;
- font-family: helvetica, arial, sans-serif;
- margin: 0;
- padding: 0;
- font-size: 12pt;
- }
- #canvas {
- position: absolute;
- left: 0;
- right: 0;
- top: 0;
- bottom: 0;
- margin: auto;
- }
- </style>
- </head>
- <body>
- <canvas id="canvas"></canvas>
- <script type="text/javascript">
- function getParameterByName(name, url) {
- if (!url) url = window.location.href;
- name = name.replace(/[\[\]]/g, "\\$&");
- var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
- results = regex.exec(url);
- if (!results) return null;
- if (!results[2]) return '';
- return decodeURIComponent(results[2].replace(/\+/g, " "));
- }
- var gameToPlay = getParameterByName("game") || "lights";
- var sampleGames = {
- memory: {
- id: "1",
- folderName: "memory",
- includePath: "memory",
- displayName: "Memory Level 3",
- backgroundColor: "#8577B3",
- backgroundHighlightColor: "#9688C4",
- complementColor: "#43B6CF",
- complementHighlightColor: "#54C7DF",
- gameIcon: "common/spr-icons-categories-lg.png",
- gameIconIndex: 2
- },
- missingpiece: {
- id: "2",
- folderName: "missingpiece",
- includePath: "missingpiece",
- displayName: "Missing Piece Level 1",
- backgroundColor: "#55AAAA",
- backgroundHighlightColor: "#66BBBB",
- complementColor: "#228888",
- complementHighlightColor: "#339999",
- gameIcon: "common/spr-icons-categories-lg.png",
- gameIconIndex: 8
- },
- swarm: {
- id: "3",
- folderName: "swarm",
- includePath: "swarm",
- displayName: "Swarm Level 2",
- backgroundColor: "#42AC71",
- backgroundHighlightColor: "#53BD82",
- complementColor: "#315B43",
- complementHighlightColor: "#426C54",
- gameIcon: "common/spr-icons-categories-lg.png",
- gameIconIndex: 11
- },
- lights: {
- id: 4,
- folderName: "lights",
- includePath: "lights",
- displayName: "Lights Level 2",
- backgroundColor: "#26455C",
- backgroundHighlightColor: "#37566D",
- complementColor: "#73E9FF",
- complementHighlightColor: "#84F1FF",
- gameIcon: "common/spr-icons-categories-lg.png",
- gameIconIndex: 5
- }
- };
- var pmGameData = sampleGames[gameToPlay];
- pmGameData.assetPath = "./";
- pmGameData.start = function() {};
- pmGameData.finish = function() {};
- var script = document.createElement('script');
- script.onload = function () {
- //do stuff with the script
- };
- script.src = "./"+gameToPlay+"/game-baked.js";
- document.head.appendChild(script);
- </script>
- </body>
- </html>
|