Refactored and cleaned up

This commit is contained in:
2021-05-26 19:34:31 +02:00
parent 05b85f2d4e
commit b911164db2
8 changed files with 159 additions and 125 deletions

View File

@@ -1,20 +1,4 @@
const app = new PIXI.Application({
autoResize: true,
resolution: devicePixelRatio,
backgroundColor: 0x0073db
window.addEventListener('beforeunload', function (e) {
// Prevent user from exiting page
e.preventDefault();
});
document.getElementById('game').appendChild(app.view);
// -------------------------------------- code --------------------------------------
// ------------------------------------ end code ------------------------------------
// Resize (Do Not modify)
window.addEventListener('resize', resize);
function resize() {
let game = document.getElementById('game');
app.renderer.resize(game.offsetWidth, game.offsetHeight);
}
resize();