@tdurtschi/bug
Version:
Bug is a simulation that models a weevil walking around in an HTML canvas.
53 lines • 2.04 kB
JavaScript
;
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var React = __importStar(require("react"));
var ReactDOM = __importStar(require("react-dom"));
var victor_1 = __importDefault(require("victor"));
require("./global.scss");
var App_1 = __importDefault(require("./components/App"));
var index_1 = require("../../index");
console.info("Starting Bug app...");
var HEIGHT = window.innerHeight;
var WIDTH = window.innerWidth;
var game = index_1.Game("#bug-ui", HEIGHT, WIDTH);
window.game = game.game;
var appProps = {
game: game.game,
height: HEIGHT,
width: WIDTH
};
var TARGET_DIV_ID = "root";
if (!document.getElementById(TARGET_DIV_ID)) {
createDivInBodyWithId(TARGET_DIV_ID);
}
ReactDOM.render(React.createElement(App_1.default, appProps), document.getElementById(TARGET_DIV_ID));
window.Victor = victor_1.default;
window.DEBUG = false;
function createDivInBodyWithId(id) {
var div = document.createElement("div");
div.id = id;
document.body.appendChild(div);
}
//# sourceMappingURL=index.js.map