Skip to content

Commit

Permalink
Don't export game
Browse files Browse the repository at this point in the history
  • Loading branch information
stasm committed Sep 1, 2019
1 parent fb11813 commit c82b359
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion minify_config.js
Expand Up @@ -5,7 +5,6 @@ export default {
output: {
file: "public/opt/game.min.js",
format: "iife",
name: "backcountry",
},
plugins: [minify({comments: false})],
};
7 changes: 3 additions & 4 deletions public/index.html
Expand Up @@ -53,18 +53,17 @@
<div><button onclick="toggle(this)">pause</button></div>
</div>
<script type="module">
import {game} from "./js/index.js";
window.game = game;
import "./js/index.js";

let running = true;
window.toggle = function toggle(button) {
if (running) {
running = false;
game.stop();
window.game.stop();
button.textContent = "resume";
} else {
running = true;
game.start();
window.game.start();
button.textContent = "pause";
}
};
Expand Down
3 changes: 0 additions & 3 deletions public/opt/index.html
Expand Up @@ -27,6 +27,3 @@
<canvas></canvas>
<main></main>
<script src="game.min.js"></script>
<script>
window.game = backcountry.game;
</script>
4 changes: 3 additions & 1 deletion src/index.ts
Expand Up @@ -2,7 +2,9 @@ import {Game} from "./game.js";
import {load} from "./model.js";
import {world_intro} from "./worlds/wor_intro.js";

export let game = new Game();
let game = new Game();
// @ts-ignore
window.game = game;

async function start() {
game.models = await load("./models.tfu");
Expand Down

0 comments on commit c82b359

Please sign in to comment.