Upgrade to Webpack 4 (including webpack-dev-server). Add ES6 support via Babel 7.

This commit is contained in:
Caleb Taylor
2019-01-07 17:11:12 -08:00
parent 448133c311
commit de3f661d0e
11 changed files with 9528 additions and 77 deletions
+24 -26
View File
@@ -1,34 +1,32 @@
import 'phaser';
import Phaser from "phaser";
import logoImg from "./assets/logo.png";
var config = {
type: Phaser.AUTO,
parent: 'phaser-example',
width: 800,
height: 600,
scene: {
preload: preload,
create: create
}
const config = {
type: Phaser.AUTO,
parent: "phaser-example",
width: 800,
height: 600,
scene: {
preload: preload,
create: create
}
};
var game = new Phaser.Game(config);
const game = new Phaser.Game(config);
function preload ()
{
this.load.image('logo', 'assets/logo.png');
function preload() {
this.load.image("logo", logoImg);
}
function create ()
{
var logo = this.add.image(400, 150, 'logo');
this.tweens.add({
targets: logo,
y: 450,
duration: 2000,
ease: 'Power2',
yoyo: true,
loop: -1
});
function create() {
const logo = this.add.image(400, 150, "logo");
this.tweens.add({
targets: logo,
y: 450,
duration: 2000,
ease: "Power2",
yoyo: true,
loop: -1
});
}