Jump to content

Uncaught ReferenceError: p2 is not defined


ccquiroga
 Share

Recommended Posts

Hello everyone, i'm making my first Phaser Game but when i run it, it shows me the followin error:

 

            Uncaught ReferenceError: p2 is not defined                                                     phaser.js:77528

 

 

im newbe developing in html5 and Phaser. so please, if anyone knows how to solve it i will apreciate it so much :)

Sorry if my english is not good hehe

Link to comment
Share on other sites

I guess you're using requireJS?

 

I'm getting the exact same error, but only when starting a new project from the official Phaser RequireJS template (https://github.com/photonstorm/phaser/tree/master/resources/Project%20Templates/RequireJS). 

 

I was following this tutorial: http://www.gamefromscratch.com/post/2014/11/20/Phaser-with-RequireJS-and-Bower.aspx but nothing loaded in the browser, and I saw the same error ( Uncaught ReferenceError: p2 is not defined phaser.js:77528) in Chrome dev tools.

 

Unfortunately, I suppose this is a well known issue with the requirejs-based template, see the discussion here: http://www.html5gamedevs.com/topic/4163-getting-p2-is-not-defined Though there is a fix/workaround mentioned in that thread, it's far too convoluted for a n00b like myself. 

 

I've been successfully playing with phaser.js in other projects where I didn't use requireJS (e.g. I finished the tutorial at http://phaser.io/tutorials/making-your-first-phaser-game), so I guess the problem arises from requirejs. 

 

In summary, I think the RequireJS Phaser template is broken. It should just work out-of-the-box and shouldn't need workarounds :-/

 

I'm just going to continue with the vanilla project template for now, and not dabble with requirejs for my phaser projects. Anyone else here have a working requireJS Phaser template?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...