a step-by-step guide
Hi, it is a nice work to learning machine learning and I like it very much. I am new to HTML and JS, can you give a step-by-step guide to install, train and play this game?
If you run index.html via file:// or C:/, then the program isn't going to work.
Instead, you need to run it via a web server.
A simple solution is to invoke python -m SimpleHttpServer from the directory containing index.html, then point your browser to localhost:8000 (or whatever port Python tells you it's running on).
@jcgoodru can u explain why do we need to run it from a web server ? 😊
If you open index.html via file:// or C:/, and open the javascript console in your browser, you'll see an error message that looks something like this:
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https
I'm not 100% sure of all the details, but basically if you open a web page via file://, your browser won't allow you to get/send requests to other servers. This is for security reasons (ex: webpages launched via file:// can access your entire filesystem and can execute malicious code, but pages rendered via webservers usually don't have these permissions).
I don't know enough to give a detailed explanation, but here are some relevant links:
https://stackoverflow.com/questions/10752055/cross-origin-requests-are-only-supported-for-http-error-when-loading-a-local https://bitmovin.com/same-origin-policy-cors-and-crossdomain-xml-what-you-need-to-know/
Use python -m http.server for Python3.
-
modify gameplay.js (Line 46) : Phaser.ScaleManager.SHOW_ALL -> Phaser.ScaleManager.NO_SCALE
-
python -m SimpleHTTPServerfrom the directory containing index.html -
open http://localhost:8000