-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js.map
1 lines (1 loc) · 4.15 KB
/
index.js.map
1
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAa,MAAM,6BAA6B,CAAC;AAEtE,MAAM,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,YAAY,CAAC,CAAC;AACpD,IAAI,CAAC,KAAK;IACN,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;AAEnE,MAAM,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;AACpD,IAAI,CAAC,EAAE;IACH,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;AAEtE,MAAM,EAAE,GAAG,QAAQ,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;AACrD,IAAI,CAAC,EAAE;IACH,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;AAEvE,MAAM,OAAO,GAAgB;IACzB,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE;YAC3B,IAAI,CAAC,IAAI,EAAE,CAAC;YACZ,UAAU,CAAC,UAAU,EAAE,CAAC;YACxB,EAAE,CAAC,SAAS,GAAG,EAAE,CAAC;YAClB,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,KAAK,EAAE,EAAE,GAAG,CAAC,CAAC;QACxC,CAAC,EAAE;IACH,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE;CAC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B,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC;AAC7D,CAAC","sourcesContent":["import { Game } from \"./engine/core/Game.js\";\r\nimport { ZergScene, Teams } from \"./scene/ZergScene.js\";\r\nimport { spawnCargo } from \"./entity/Cargo.js\";\r\nimport { spawnZerg } from \"./entity/Zerg.js\";\r\nimport { ControlPanel, IUIAction } from \"./engine/ui/ControlPanel.js\";\r\n\r\nconst board = document.getElementById(\"game-board\");\r\nif (!board)\r\n throw new Error(\"Element #game-board not found in html page!\");\r\n\r\nconst cp = document.getElementById(\"control-panel\");\r\nif (!cp)\r\n throw new Error(\"Element #control-panel not found in html page!\"); \r\n \r\nconst wm = document.getElementById(\"winner-message\");\r\nif (!wm)\r\n throw new Error(\"Element #winner-message not found in html page!\"); \r\n\r\nconst actions: IUIAction[] = [\r\n { title: \"Start\", action: () => { \r\n game.stop(); \r\n scoreBoard.clearScore();\r\n wm.innerHTML = \"\"; \r\n setTimeout(() => game.start(), 100); \r\n } },\r\n { title: \"Stop\", action: () => game.stop() }\r\n];\r\nconst teams = [\r\n { type: Teams.player, title: \"Player\", plural: false},\r\n { type: Teams.zergs, title: \"Zergs\", plural: true}\r\n];\r\n\r\nconst scoreBoard = new ControlPanel<Teams>(cp, actions, teams, (team, score) => {\r\n if (score < 10)\r\n return;\r\n \r\n game.stop();\r\n const winningTeam = teams.find(data => data.type === team)!;\r\n showWinner(winningTeam.title, winningTeam.plural);\r\n});\r\nconst game = new Game(new ZergScene(board, spawnCargo, spawnZerg, scoreBoard), 1);\r\n\r\ngame.start();\r\n\r\n//setInterval(() => game.stop(), 30000);\r\n\r\nfunction showWinner(winner: string, pluralForm: boolean): void {\r\n if (wm!.children.length > 0)\r\n return;\r\n\r\n const message = document.createElement(\"div\");\r\n message.textContent = `${winner} ${pluralForm ? \"win\" : \"wins\"}!`;\r\n message.classList.add(\"winner-message\");\r\n wm!.appendChild(message);\r\n setTimeout(() => message.classList.add(\"animation\"), 50);\r\n}"]}