Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TypeError: R[o5R.F6s] is not a function in changing states in phaser box2d

i build my game using phaser.2.4.3.min.js and phaser.2.2.2.box2d.min.js When trying to change states this error is being raised TypeError: R[o5R.F6s] is not a function and i can't seem to figure out the problem

PS : i took The source code of box2d plugin from the example folder in phaser , and i did not purchase the full plugin yet i was just testing it .

is there anyway to fix this issue ?

here is the game code : http://jsfiddle.net/fbdtq1tg/5/

and here where the error is raised :

SetGameOver: function () {
            this.game.state.start("TheGame");
        }

enter image description here

like image 414
Sora Avatar asked Jan 21 '26 08:01

Sora


1 Answers

The error seems clear: the script is trying to execute a function, but this variable isn't a function.

What happens: box2d.m_gravity = box2d.clone(); but R[o5R.F6s]() is the string "clone" and not a function. R = box2d, so the the script is trying to execute a function(R[o5R.F6s](). o5R is an object with a lot of functions in it but the requested F6s is a string("clone").

So, I did some research why box2d.b2world = function(gravity){...this.m_gravity = gravity.Clone();.. } and it seems to be a bug.

Check out following links:

  • http://www.html5gamedevs.com/topic/13753-changing-states-with-box2d-causes-crash/
  • https://github.com/photonstorm/phaser/issues/1884
like image 197
GuyT Avatar answered Jan 23 '26 22:01

GuyT