AidanPTD Posted March 22, 2018 Share Posted March 22, 2018 Hi, In currently trying to host a Phaser game with GitHub Pages, but it's not showing up. I've looked at the code for this game, and it all seems fine, as well as the index.html for the page. I'd like a fresh pair of eyes, so would anyone mind taking a look at the source code? Thanks to everyone in advance! Git Hub Repository: https://github.com/AidanPTD/Games Git Hub Pages: https://aidanptd.github.io/Games/ Link to comment Share on other sites More sharing options...
samme Posted March 23, 2018 Share Posted March 23, 2018 Quote SyntaxError: Unexpected token '{'. import call expects exactly one argument. main.js:6 Link to comment Share on other sites More sharing options...
AidanPTD Posted March 23, 2018 Author Share Posted March 23, 2018 @samme, I tried removing line 6, but now the camera doesn't move as expected. How would I change this line to work properly? import {Math} from "phaser-ce"; Link to comment Share on other sites More sharing options...
samme Posted March 23, 2018 Share Posted March 23, 2018 I don't see where else Math is used, but you can use Phaser.Math instead (no import). Are you writing TypeScript? It looks sort of like TypeScript but it doesn't seem to be compiled to JS. Link to comment Share on other sites More sharing options...
AidanPTD Posted March 23, 2018 Author Share Posted March 23, 2018 I'm actually trying to modify the code from this tutorial and add some things to it. But I'll try your suggestion. Link to comment Share on other sites More sharing options...
AidanPTD Posted March 23, 2018 Author Share Posted March 23, 2018 @samme, your suggestion didn't work, unfortunately. I'm still unsure of what to do... I'm getting "phaser-ce" from the file "phaser.d.ts" in a different folder, which I linked the "main.js" file to successfully. I'm also not sure if the example that I'm following is based on JavaScript or TypeScript, but it seems like it's using JavaScript (it says so in the tutorial..). Should I try converting my file to typescript and try from there, or do you have any other ideas? Link to comment Share on other sites More sharing options...
Recommended Posts