phaserjs / phaser

Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
https://phaser.io
MIT License
36.94k stars 7.08k forks source link

[2.20] enableDebug: false and error #1407

Closed DanielSitarz closed 9 years ago

DanielSitarz commented 9 years ago

Hey.

I have got disabled debug and in version 2.20 I gets: phaser-arcade-physics.js:18499 Uncaught TypeError: undefined is not a function This line is: (method Phaser.StateManager#clearCurrentState)

  if (this.game.debug)
  {
    this.game.debug.reset();
  }

this.game.debug exists cuz of this: (method Phaser.Game#boot)

this.debug = { preUpdate: function () {}, update: function () {} };

So expression evals to true.

photonstorm commented 9 years ago

Just add reset to it for the moment and it'll be fine. Do it in your game init or boot state:

game.debug = { preUpdate: function () {}, update: function () {}, reset: function () {} };

photonstorm commented 9 years ago

Should now be fixed in dev. There's a major upstream Pixi issue with alpha on sprites at the moment, so I'm likely to release a 2.2.1 this week.