Jump to content

Webserver - BIG problem!


KnTproject
 Share

Recommended Posts

Hello,

Yesterday I installed Phaser, but now I have got a big problem (For me it's a big problem). I followed the Phaser tutorial for beginners. The tutorial that explains how to get a star on the screen in the top left corner. For people who don't know what I am talking about, here is a link: http://phaser.io/tutorials/making-your-first-phaser-game/part2.
I don't have any knowledge about webservers or things like that, but I got this message:

Phaser.min.js:4 Uncaught SecurityError: Failed to execute 'texImage2D' on 'WebGLRenderingContext': The cross-origin image at ... may not be loaded.

I know the problem, I can't export the images to my HTML, because it has something to do with security reasons (CORS, I think).  I also saw on the Phaser site that I have to install something like a web server. I looked at node.js, but I didn't understand anything. Can somebody help me please?

Link to comment
Share on other sites

thx for the question, i have just discovered that tutorial

yesterday i have made a pen on codepen.io that looks like it http://codepen.io/featuresmega/pen/WGQEaw

it should works with the star

In the phaser.io language :

  • the key is : 'tree'
  • the loaded asset is a crossorigin sprite i have uploaded on imgur

Just click on the link it will bring it up to you browser, but if you want to bring an index.html page it should look like a standard phaserjs project

the background in this pen project is an isometric landscape that needs a boost to be displayed (it's in the //comment) and of course the tree is a part of it

Link to comment
Share on other sites

If you've already got node installed you are just two steps away from several ways to fire up a server

npm install -g serve
serve path/to/index.html

If you aren't comfortable with a CLI then I'd recommend you get comfortable with it, it might be tempting to use something with a gui in the interim but then you wont learn anything ;) 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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