Jump to content

Cant Load Tile Map In Phaser


Noaml1
 Share

Recommended Posts

I'm trying to follow the starstruck tutorial in typescript, but for some reason when i add the line 

            this.game.load.tilemap('level1', 'assets/level1.json', null, Phaser.Tilemap.TILED_JSON)

my game wont run passed the preload method. The file path is definitely correct - and i know this because the other files in the same folder are loading fine (tested).

Chrome is giving me the error:

Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:16322/assets/level1.json
Uncaught SyntaxError: Unexpected token < localhost/:1
 

what could be causing this? 'assets/level1.json' is definitely it's location (look at screen shot below).

post-8681-0-41507500-1400693143_thumb.pn

Link to comment
Share on other sites

Do you have mimetypes setup for JSON?

 

In your web.config file just paste this:

 

<configuration>  <system.web>    <compilation debug="true" targetFramework="4.5" />    <httpRuntime targetFramework="4.5" />  </system.web>  <system.webServer>    <staticContent>      <mimeMap fileExtension=".json" mimeType="application/json" />    </staticContent>  </system.webServer></configuration>

Let me know if that did nothing.

Link to comment
Share on other sites

  • 4 weeks later...
  • 8 months later...
 Share

  • Recently Browsing   0 members

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