Jump to content

HTML for running examples on Cloud9


buttonsrtoys
 Share

Recommended Posts

I'm a newbie with my new Cloud9 account who created a new workspace and imported the current build of Phaser from Github. I then wrote a simple HTML file in the same workspace and copied the asteroids-movement JS into it, but this JS code isn't finding the Phaser JS code? (I'm getting a "'Phaser' is not defined" error).

 

Below is the beginning of the HTML where I'm trying to reference the Phaser code. The "build" folder is at the same level as the HTML file. 

<!doctype html>    <html lang="en">    <head>        <title>First Game</title>                <!-- attempt to link to phaser -->        <script type="text/javascript" src="build/phaser.js"></script>        <script type="text/javascript" src="build/custom/phaser-arcade-physics.js"></script>    </head>    <body>        <div>            <script>                // Below gets "'Phaser' is not defined" error                var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', {                    preload: preload,                    create: create,                    update: update,                    render: render                });                function preload() {                         . . .
Link to comment
Share on other sites

It's hard to help you without seeing your workspace. It seems like you didn't put phaser.js in the build/ folder, but with so few information I can't tell more. Could you share a screenshot of the structure of your project? Like the folder hierarchy?

Link to comment
Share on other sites

Thanks for the thoughts. After posting I found that the app is finding the Phaser JS code fine, but I'm still getting the warning. Attached is a screenshot of my workspace, where I'm hovering over the warning.

 

So, I'm up and running, but not sure why I'm getting the warning and would like to get rid of the warning if possible.

post-16125-0-11744000-1440685366.jpg

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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