简体   繁体   中英

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");
        }

在此输入图像描述

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:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM