sparksflyupwards Posted January 16, 2014 Share Posted January 16, 2014 Hi I am a beginner to javascript and to the Phaser framework and so far I am loving it!However I've gotten to a problem that I have been trying to fix for days with no luck... I could sure use some help I am trying to convert my phaser game into phaser states following the basic template in the phaser examples file.The problem I have is that I cant seem to add a group outside of the game prototype.My game prototype:"BasicGame.Game.prototype = { ...};"and my game constructor:"BasicGame.Game = function (game) {...}; seem to work fine in that the game runs without error except when I try to add a group with this.add.group();I must add the group outside of the game prototype because else I will not be able to add sprites to it using functions notcontained in the prototype! I have tried all solutions I could think of or search, does anyone have any suggestions? Link to comment Share on other sites More sharing options...
jcs Posted January 17, 2014 Share Posted January 17, 2014 we really need a little more information in order to help. what are you trying to accomplish? when you say "this.add.group()" what object is this call made from (i.e. what object is "this" referring to)? where do you want to call addGroup() from exactly? sparksflyupwards 1 Link to comment Share on other sites More sharing options...
sparksflyupwards Posted January 17, 2014 Author Share Posted January 17, 2014 Edit:Ignore this post. How can I delete it? Link to comment Share on other sites More sharing options...
sparksflyupwards Posted January 17, 2014 Author Share Posted January 17, 2014 we really need a little more information in order to help. what are you trying to accomplish? when you say "this.add.group()" what object is this call made from (i.e. what object is "this" referring to)? where do you want to call addGroup() from exactly?I just wrote you a giant description of what the problem was.In writing the description I solved the problem.I love you. Thanks Link to comment Share on other sites More sharing options...
jcs Posted January 17, 2014 Share Posted January 17, 2014 no worries, glad you were able to find a solution sparksflyupwards 1 Link to comment Share on other sites More sharing options...
Mike Posted January 17, 2014 Share Posted January 17, 2014 Hey sparksflyupwards I'm happy you found a solution but for the sake of others reading the topic couldyou explain the fix, so instead of deleting this topic it will remain useful for someone else later. Heppell08 1 Link to comment Share on other sites More sharing options...
Recommended Posts