Closed AMPITUP closed 10 years ago
Thats the very same question ive been asking myself for a while now.
Alex notifications@github.com wrote:
Ok, I went through ALL the files here to understand what was going on. There was one or two spots in the JS that I didn't get what was going on, but, then again, I am not very familiar with CreateJS. Anyway, it looked like there were nearly all the features implemented. I downloaded the .zip file, and nothing at all works. Just out of curiosity, why is there so much code (that I couldn't find any errors in, not that I really looked hard or anything though), and no working features? Sorry about my ignorance, but I just kinda wondered why nothing worked and what needs to be done (coding-wise) that I might be able to do.
Reply to this email directly or view it on GitHub: https://github.com/HTML5-Games/vilify/issues/84
The main contributors are Logan and sru (I think), so I just thought that they might be able to give me a job or at least give me a hint at what is going on.
It works for me. You might have cross domain issues because modern browsers prevent people from loading images while opening locally.
You need a simple server that can serve directories. For example, you can do:
python3 -m http.server
python -m SimpleHTTPServer
with Python 2 and 3.
And please ask when you have doubt about what each part does.
Ok, well, what are you saying works? The whole game, or just part. Cuz, on the Vilify site, I get slightly more than what I get if I download and run locally, but there are still no images or working stuff. Oh, and I didn't really understand what you meant by the python thingy.
I mean that it does what it should do. We've been implementing parts of the game, so it might not look finished/polished. On the Vilify site is outdated version of the game.
If you just click the html file and open in browser, it says XMLHttpRequest cannot load file://path/to/file/images/logo.png. Cross origin requests are only supported for HTTP.
So, you have to use server to serve the whole Vilify directory and open the html file via localhost:8080 (or whatever port you use for localhost server).
So, I open the file in my browser and then change the url?
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Same_origin_policy_for_JavaScript
Read Cross-origin network access.
Ok.
sRy, but that didn't make sense. Oh well...
Well, I don't know how else would I explain this...
Modern browsers prevent loading images if you open the html file by clicking on it.
Ok, so then do I open it some other way?
"Well, I don't know how else would I explain this... Modern browsers prevent loading images if you open the html file by clicking on it."
firefox doesnt
^How about Safari?
Safari probably does, and Chrome does too.
@Graeme22 I didn't know. Now I know.
A temporary work around for this issue is to change the first line of objects.json
from {
to Game.DATA = {
and then save the file as objects.js
. After that, in index.html
, add <script src="game_data/objects.js"></script>
after <script src="js/main.js"></script>
(line 23).
Oh. Ok. So, I'll fork it and then make those changes to see it?
I tried it and it didn't work.
Try opening it with Firefox. According to @Graeme22 it doesn't block loading images. It didn't work for me without using server.
Ok. Will do. Thx.
Ok, I went through ALL the files here to understand what was going on. There was one or two spots in the JS that I didn't get what was going on, but, then again, I am not very familiar with CreateJS. Anyway, it looked like there were nearly all the features implemented. I downloaded the .zip file, and nothing at all works. Just out of curiosity, why is there so much code (that I couldn't find any errors in, not that I really looked hard or anything though), and no working features? Sorry about my ignorance, but I just kinda wondered why nothing worked and what needs to be done (coding-wise) that I might be able to do.