EMoney Posted June 26, 2016 Share Posted June 26, 2016 Hi people, I've recently just started using the Phaser framework 2 days ago and I am developing my first game, an RPG with phaser...I recently just ran into an issue in my character select state where my scope(this) becomes the window scope and does not recognize my internal functions. Any insight on my issue would be extremely helpful. thank you!!! Link to comment Share on other sites More sharing options...
Str1ngS Posted June 27, 2016 Share Posted June 27, 2016 I think it's because you're using the far arrow to create your prototype methods. You can read the Gotchas/Pitfall part of the following article to get a nice explanation: https://www.sitepoint.com/es6-arrow-functions-new-fat-concise-syntax-javascript/ So try just using: init: function () { Link to comment Share on other sites More sharing options...
EMoney Posted June 28, 2016 Author Share Posted June 28, 2016 @Str1ngS Thanks a lot I happened to figure it yesterday after I slept on it but the article you linked me is very informative . Gotta brush up on my es6 before i start to go crazy with it haha. Link to comment Share on other sites More sharing options...
Recommended Posts