Upgrade to Webpack 4 (including webpack-dev-server). Add ES6 support via Babel 7.
This commit is contained in:
+24
-26
@@ -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
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user