hellspawn_bg Posted October 24, 2014 Share Posted October 24, 2014 I have a parent group that contains several child groups. Apparently only the update function of the parent group get's called. I would also like to call the update function of the childs. Is there a direct way to solve this, without iterating through the childs and manually calling update()? Thanks Link to comment Share on other sites More sharing options...
xerver Posted October 24, 2014 Share Posted October 24, 2014 Phaser definitely calls the child update functions:https://github.com/photonstorm/phaser/blob/master/src/core/Group.js#L1175This can happen if you subclass Phaser.Group but forget to call the parent function when you are overriding methods: function MyGroup() { Phaser.Group.apply(this, arguments);}MyGroup.prototype = Object.create(Phaser.Group.prototype);MyGroup.prototype.constructor = MyGroup;// if you override, make sure to call the parent function.MyGroup.prototype.update = function () { Phaser.Group.prototype.update.apply(this, arguments);}; Link to comment Share on other sites More sharing options...
Recommended Posts