Skip to content

Commit

Permalink
attempt at resize
Browse files Browse the repository at this point in the history
  • Loading branch information
wulfdewolf committed Mar 11, 2024
1 parent 2b7e73b commit c47866f
Showing 1 changed file with 30 additions and 24 deletions.
54 changes: 30 additions & 24 deletions kaja_game/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,35 @@ import nightScene from "./nightScene.js"
import endScene from "./endScene.js"


const config = {
type: Phaser.AUTO,
parent: "gameCanvas1",
backgroundColor: '#000001',
// scene: {
// preload: preload,
// create: create,
// update: update
// },
physics: {
default: 'arcade',
arcade: {
debug: false,
window.onload = function() {
let parentElement = document.getElementById('gameCanvas1');

const config = {
type: Phaser.AUTO,
parent: "gameCanvas1",
width: parentElement.offsetWidth,
height: parentElement.offsetHeight,
backgroundColor: '#000001',
// scene: {
// preload: preload,
// create: create,
// update: update
// },
physics: {
default: 'arcade',
arcade: {
debug: false,
}
},
scale: {
mode: Phaser.Scale.RESIZE,
}
}
},
scale: {
mode: Phaser.Scale.RESIZE,
}
}

const game = new Phaser.Game(config);
game.scene.add('dayScene', dayScene);
game.scene.add('titleScene', titleScene);
game.scene.add('nightScene', nightScene);
game.scene.add('endScene', endScene);
game.scene.start('titleScene');
const game = new Phaser.Game(config);
game.scene.add('dayScene', dayScene);
game.scene.add('titleScene', titleScene);
game.scene.add('nightScene', nightScene);
game.scene.add('endScene', endScene);
game.scene.start('titleScene');
}

0 comments on commit c47866f

Please sign in to comment.