Jump to content

Phaser 2.0 Uncaught: TypeError


Karnage
 Share

Recommended Posts

Hi Guys,

 

Excellent work on releasing Phaser 2.0 - I thought it would be time to move over from Construct 2 and try my hand at coding (i'm a newb so please be gentle) :)

 

I have loaded up the golf demo that comes with 2.0 and have not been able to get it to load correctly. 

 

Here is the error that I am seeing in Chrome's JavaScript console:-

 

  1. Uncaught TypeError: Cannot read property 'bounce' of null golf.js:45
    1. Phaser.StateManager.loadCompletephaser.js:13673
    2. Phaser.SignalBinding.executephaser.js:14353
    3. Phaser.Signal.dispatchphaser.js:14226
    4. Phaser.Loader.nextFilephaser.js:41327
    5. Phaser.Loader.jsonLoadCompletephaser.js:41185
    6. _xhr.onloadphaser.js:40888
 
 
Here is how I included the golf.js in my html doc:-
 
<!doctype html><html>    <head>        <meta charset="UTF-8" />        <title>hello phaser!</title>        <script src="phaser.js"></script>        <script src="golf.js"></script>    </head>    <body>        <div id="phaser-example">                    </div>    </body></html>

Here is my file structure:-

 

PJSFiles.png

 

Here is the result in Chrome (its also the same in FireFox):-

 

result.png

 

Maybe I have made a "Newb" mistake :) but any pointers in the right direction would be gratefully received :)!

 

Many thanks in advance.

 

Link to comment
Share on other sites

Hmm I thought we had removed the golf demo from 2.0! It needs updating to work with 2.0 as most the physics calls have changed. I just checked and it's not in the examples repo, did you find it somewhere else? Or have it left over from an earlier download?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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