Skip to content

Commit

Permalink
example changed with better options
Browse files Browse the repository at this point in the history
  • Loading branch information
kleber-jg committed Aug 22, 2021
1 parent 7641d21 commit 8af844e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
1 change: 0 additions & 1 deletion config/bs-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ module.exports = {
'./example/**/*'
],
ghostMode: false,
open: false,
};
21 changes: 12 additions & 9 deletions example/game.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'game', { preload: preload, create: create, update: update, render: render });
const game = new Phaser.Game({
width: 1920,
height: 1080,
renderer: Phaser.AUTO,
parent: 'game',
scaleMode: Phaser.ScaleManager.EXACT_FIT,
state: { preload, create, update },
});

function preload() {
game.stage.backgroundColor = '#007236';
Expand All @@ -7,12 +14,12 @@ function preload() {
game.load.image('phaser', 'assets/sprites/phaser1.png');
}

var cursors;
var logo1;
var logo2;
let cursors;
let logo1;
let logo2;

function create() {
// game.plugins.add(new PhaserRuntimeEditor(game, game.root));
game.plugins.add(new PhaserRuntimeEditor.Plugin(game));
// Modify the world and camera bounds
game.world.setBounds(-1000, -1000, 2000, 2000);

Expand Down Expand Up @@ -45,7 +52,3 @@ function update() {
if (cursors.left.isDown) game.camera.x -= 4;
else if (cursors.right.isDown) game.camera.x += 4;
}

function render() {
game.debug.cameraInfo(game.camera, 32, 32);
}

0 comments on commit 8af844e

Please sign in to comment.