0

https://github.com/mliu95/quintus-tag

Source code is there.

I was following Liu's tutorial on this (https://mliu95.github.io/2014/09/16/Creating-an-online-multiplayer-web-game-using-Socketio-and-Quintus-Part2/)

Part 1 worked perfectly fine (single player with a movable sprite). However, upon introducing multiplayer (accomplished by opening multiple windows with localhost:8080), the sprites simply don't appear on the screen. enter image description here

Also, you are dealing with a complete noob in terms of networking. I know a decent amount of Java but have no experience whatsoever. Any advice would be greatly appreciated.

kevin shen
  • 61
  • 6

1 Answers1

0

You didn't give much information to go on, and didn't respond to my question in the comments that could clarify the issue.

But here is what I think is happening, in part one of the tutorial he lists his sprite paths here:

  var files = [
'/images/tiles.png',
'/maps/arena.json',
'/images/sprites.png',
'/images/sprites.json'
];

I'm assuming your sprites are 404'ing (not being found), so here is a possible fix.

Your file structure is probably not the same as his, where are you storing the sprite images locally (on your pc)? It needs to be in the same paths as shown above. Sprites should be located in YourProjectFolder/images. Make sure your your sprite file is named sprites.png

After making sure all those files are placed correctly, open your developer tools (f12), head to the network tab, check the "disable cache" box (if you're on chrome). And refresh.

It should load your sprites after these changes, and if not, you need to post the specific errors you are running into. The errors will show up in developer tools after you refreshed, if it is still unable to find them.

Good luck

Edon
  • 1,116
  • 2
  • 22
  • 47
  • Failed to load resource: net::ERR_CONNECTION_TIMED_OUT – kevin shen Jul 26 '16 at 20:14
  • That is the error. I tried to disable cache but it doesn't seem to resolve the issue. Also checked the sprite file and their locations. this worked on the singleplayer version (part 1 of his tutorial) – kevin shen Jul 26 '16 at 20:14
  • That's odd. Could be an adblock issue? http://stackoverflow.com/a/16489976/6437335 I'd try to post again, perhaps with screenshots of the error with the network tab open, and pasting in relevant parts of your code – Edon Jul 26 '16 at 20:19