Jump to content

phaser not defined but phaser.js import


French Nerd
 Share

Recommended Posts

Hi everyone !

I beginning Phaser and javascript today, and something wrong was happened. I have this error :

main.js:1 Uncaught ReferenceError: phaser is not defined.

But I have already import phaser.js (wich contain the Phaser variable) in my index.html, look at my code !

index.html

    <!DOCTYPE html>
    <html>
        <head>
            <meta charset ="utf-8" />
            <title>My first game</title>
            <script src="js\phaser.js"></script>

            <style>
                body{
                    background: black;
                }
            </style>
        </head>

        <body>
            <script src = "js/main.js"></script>
        </body>
    </html>

main.js


    var game = new phaser.Game(640,360, Phaser.AUTO);

    var GameState = {
        preload : function(){

        },

        create : function(){

        },

        update : function(){

        },

    }; 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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