NokFrt Posted May 14, 2018 Share Posted May 14, 2018 Hello, In Phaser 2 Sprite/Image/... has update() function which is called each step. In Phaser 3 GameObjects also have update() function but this function is never called. I use Typescript. I create a new class which extends Phaser.GameObject.Sprite and I implement my own update() method in the new class. I add an object created from the class to a scene with this.add.existing(mySprite);. Does anybody know where's the problem? Link to comment Share on other sites More sharing options...
B3L7 Posted May 14, 2018 Share Posted May 14, 2018 I'm fairly certain this is by design. The examples that I've seen (and the way I do it) is to call the sprite's update function from the scene's update, so: //Scene Class update(time, delta) { sprite.update(time, delta); group.children.entries.forEach( (child) => { child.loop(time, delta); } ) } Link to comment Share on other sites More sharing options...
snowbillr Posted May 14, 2018 Share Posted May 14, 2018 https://github.com/photonstorm/phaser/pull/3379 and https://github.com/photonstorm/phaser/issues/3378 talk about this issue in more detail Link to comment Share on other sites More sharing options...
Recommended Posts