From 8af844e2aaa2a8586f0c8b1b4eb3fb463bd98741 Mon Sep 17 00:00:00 2001 From: Kleber Silva Date: Sun, 22 Aug 2021 12:28:44 -0300 Subject: [PATCH] example changed with better options --- config/bs-config.js | 1 - example/game.js | 21 ++++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/config/bs-config.js b/config/bs-config.js index 8fe3f6f..b12f67e 100644 --- a/config/bs-config.js +++ b/config/bs-config.js @@ -15,5 +15,4 @@ module.exports = { './example/**/*' ], ghostMode: false, - open: false, }; \ No newline at end of file diff --git a/example/game.js b/example/game.js index 0ff55c9..d843fd0 100644 --- a/example/game.js +++ b/example/game.js @@ -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'; @@ -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); @@ -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); -}