isfuturebright Posted February 24, 2014 Share Posted February 24, 2014 I have a ClassA that extends Phaser.Sprite and I do the following:this.a = new Class(this.game);this.add.existing(this.a);On ClassA.js:ClassA = function(game, x, y, texture){ Phaser.Sprite.call(this, game, x, y, texture);};ClassA.prototype = Object.create(Phaser.Sprite.prototype);ClassA.prototype.constructor = ClassA;ClassA.prototype.update = function(){ console.log("here");};Log isn't showing up. The object is being rendered but the update is not being called. Do I have to call it manually on my state's update? Link to comment Share on other sites More sharing options...
rich Posted February 25, 2014 Share Posted February 25, 2014 Sorry this was my mistake, I accidentally defined Stage.update twice, so the original method was over-written. If you do a fresh pull you should find the above code works perfectly now. Link to comment Share on other sites More sharing options...
isfuturebright Posted February 25, 2014 Author Share Posted February 25, 2014 Thanks rich! Tought I was doing some mess. Is the phaser inside the build folder updated? Link to comment Share on other sites More sharing options...
rich Posted February 27, 2014 Share Posted February 27, 2014 I updated the build version just now, so it's safe to use that one. Link to comment Share on other sites More sharing options...
Recommended Posts