From 7b1816de61a200a6d495ead5021a6242d3ceabd5 Mon Sep 17 00:00:00 2001 From: Dominik George <nik@naturalnet.de> Date: Thu, 22 Apr 2021 21:37:09 +0200 Subject: [PATCH] Rename canvas to game and fix code order and import/export --- src/frontend/{canvas.js => game.js} | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) rename src/frontend/{canvas.js => game.js} (71%) diff --git a/src/frontend/canvas.js b/src/frontend/game.js similarity index 71% rename from src/frontend/canvas.js rename to src/frontend/game.js index 8861316..f49a515 100644 --- a/src/frontend/canvas.js +++ b/src/frontend/game.js @@ -1,24 +1,26 @@ -import * from phaser; +import Phaser from 'phaser'; -var scene = { +function preload () +{ + this.load.image('404', 'http://labs.phaser.io/assets/sprites/phaser3-logo.png') +} +function create () +{ + this.add.image(300, 400, '404') +} + +let scene = { preload: preload, create: create }; -var config = { +let config = { type: Phaser.AUTO, width: 800, height: 600, scene: scene }; -var game = new Phaser.Game(config); +let game = new Phaser.Game(config); -function preload () -{ - this.load.image('404', 'http://labs.phaser.io/assets/sprites/phaser3-logo.png') -} -function create () -{ - this.add.image(300, 400, '404') -} \ No newline at end of file +export default game; -- GitLab