Skip to content
Snippets Groups Projects
Verified Commit 6ac56824 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Restructure frontend code and instantiate game

parent 7b1816de
No related branches found
No related tags found
No related merge requests found
Pipeline #7273 passed
import Phaser from 'phaser'; import Phaser from 'phaser';
import TestScene from './scenes/test';
function preload () class Game {
{ constructo() {
this.load.image('404', 'http://labs.phaser.io/assets/sprites/phaser3-logo.png') this.config = {
} type: Phaser.AUTO,
function create () width: 800,
{ height: 600,
this.add.image(300, 400, '404') scene: TestScene
} };
let scene = {
preload: preload,
create: create
};
let config = { this.game = new Phaser.Game(this.config);
type: Phaser.AUTO, }
width: 800, }
height: 600,
scene: scene
};
let game = new Phaser.Game(config);
export default game; export default Game;
function preload () {
this.load.image('404', 'http://labs.phaser.io/assets/sprites/phaser3-logo.png')
}
function create () {
this.add.image(300, 400, '404')
}
let TestScene = {
preload: preload,
create: create
};
export default TestScene;
import WidgetBackend from './backends/widget'; import WidgetBackend from './backends/widget';
import Game from './frontend/game';
let game = Game();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment