• Content count

  • Joined

  • Last visited

  1. init parameters is undefined

    Thanks @jamespierce. I think the issue is because I had previously been using phaser-state-transition.min.js to animate state transitions. I had recently stopped using phaser-state-transition while I was testing something out but hadn't removed the script tag from index.html. This appeared to be overriding the normal function.
  2. init parameters is undefined

    @jamespierce It has showing as undefined in the CongratulationsState. I'll update my original post.
  3. init parameters is undefined

    Thanks for the suggestion @FenopiĆ¹, I'll give that a go. I haven't got an link available at the moment @jamespierce, as soon as I do I'll let you know.
  4. init parameters is undefined

    In Phaser 2.7.5 I'm trying to pass an object as a parameter from one state to another but the object is showing as undefined. Below is the code from GameState whereby I'm looking to pass an object containing a score, time and seconds. "Congratulations", true, false, { score: this.killedGerms, time: this.timeLabel.text, seconds: this.remainingSeconds }); Below is the CongratulationsState where the parameter, "data", is coming through as "undefined". init: function(data) { console.log('data', data); data = data || { score: 0, time: "00:00", seconds: 0 }; } Any ideas on where I have gone wrong would be greatly appreciated.
  5. I am looking to extend the Phaser tutorial "Making your first Phaser game" ( by introducing states as described in this post "Understanding Phaser states" ( The Update function in my play.js provides an overlap callback to a custom function called gameOver (line 161). It is at this point on line 179 whereby, and hence 'state', is undefined as 'this' is now referring to the custom function. The tutorial 'understanding Phaser states' references inside custom functions yet doesn't error. Hoping someone could point myself in the right direction in resolving this issue. The code can be viewed on Github