-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
Description
Version
- Phaser Version: 3.50.0-beta.5
- Operating system: Windows 10
- Browser: chrome and firefox
Description
if you import phaser with webpack
Phaser.Time is undefined in method Phaser.Time.Clock#addEvent
Example Test Code
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,
},
};
var game = new Phaser.Game(config);
function preload() {
this.load.image("logo", logoImg);
}
function create() {
var logo = this.add.image(400, 150, "logo");
var _this = this;
this.time.addEvent({
delay: 10000,
callback: function () {
_this.tweens.add({
targets: logo,
y: 450,
duration: 2000,
ease: "Power2",
yoyo: true,
loop: -1,
});
},
});
}
Additional Information
most likely Phaser.Time.TimerEvent should be TimerEvent in "phaser\src\time\Clock.js"