buttonsrtoys Posted August 26, 2015 Share Posted August 26, 2015 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 More sharing options...
Skeptron Posted August 27, 2015 Share Posted August 27, 2015 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 More sharing options...
buttonsrtoys Posted August 27, 2015 Author Share Posted August 27, 2015 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. Link to comment Share on other sites More sharing options...
Skeptron Posted August 27, 2015 Share Posted August 27, 2015 I don't get it... Is it a runtime error, displayed in the console while you run the game, or is it a warning in your text editor? Because I don't recognise it and can't help if it's the case. Link to comment Share on other sites More sharing options...
buttonsrtoys Posted August 30, 2015 Author Share Posted August 30, 2015 As shown in my screen grab, the warnings in the text editor on line 14. It also appears everywhere I reference "Phaser" Link to comment Share on other sites More sharing options...
boomer1204 Posted September 1, 2015 Share Posted September 1, 2015 In the screenshot it looks like you haven't saved the file since any last changes. If those changes include the src to the file that could be messing with ya. Link to comment Share on other sites More sharing options...
buttonsrtoys Posted September 1, 2015 Author Share Posted September 1, 2015 I have this problem with all my files, saved or not. Link to comment Share on other sites More sharing options...
netcell Posted September 2, 2015 Share Posted September 2, 2015 It's a warning of the text editor of Cloud9, using jslint if I remember correctly. It doesn't matter at all. Just ignore it or turn it off or learn about jslint to change the setting to fit your needs. buttonsrtoys 1 Link to comment Share on other sites More sharing options...
Recommended Posts