Socket.IO: Drawing Connected Players - Part 5 - Creating Multiplayer Games - pusugames.com

Socket.IO: Drawing Connected Players – Part 5 – Creating Multiplayer Games

Brent Aureli Codes
Views: 11853
Like: 157
Creating Multiplayer Games with using LibGDX and NodeJS.

Learn how to turn you game into a client that can connect to a back end server and communicate with other clients via network sockets through the library Socket.IO. We will discuss the creation of both the back end server and the game client as well as connecting them together into a fully functional multiplayer game!

Source:
Github:
YouTube Channel:
Facebook:
Twitter:

11 Comments

  1. why not to run server socket from java code? Because node is easier to start? or is there other reasons? Interesting to know

  2. Hey Brent! Enjoying this series so far. Learning a lot of things about Node.Js ^.^

    I was wondering, after this tutorial series, if you could maybe look into random generation of levels/worlds and/or procedural generation? Not many, or at all, tutorials about it on the internet using Libgdx. Would so appreciate it if you could look into it :D.

    Keep up the good work!

  3. The thing im most confused about is real time movement. Like being able to see other peoples characters move on your screen.

    I only know how to do this with sending a bunch of http requests every second to a rest server, but i dont think this is the current way.

    EG (sudo):

    Sending my location:
    POST myPost(100,100);
    POST myPost(102,100);
    ect..

    and then you would also receive the positions of others with a bunch of http requests every second and render their movement.

  4. I'm getting an error "No OpenGL context found in the current thread" when trying to create a new friendly inside the new player emitter listener.

    My fix was to create a list of Strings to add, and when the emitter listener is called, it adds the new id to the list. Then in the render method it checks if the list.size() is greater than 0, and if so, the friendly is created and added along with the id to the hashmap. Then I remove the id from the list. Is there a better way of fixing this? I don't know how to access the ui thread directly from another thread in gdx

  5. can't use HashMap.Entry because it's not public

  6. Can I use this method to do multiplayer between Desktop and Android?

  7. I went ahead and gave my Sprite a body, and I get the following error if I create the body inside the new-player event:
    Exception in thread "EventThread" java.lang.RuntimeException: No OpenGL context found in the current thread.
    this must have somehing to do with the fact that I created a body, so How to I go about fixing this?

  8. Thanks for the video. I am abit confused as to how you managed to get the hashMap value shared between multiple instance of the game i.e when player 1 started the map is empty and only gets populated with data when player 2 connects. However how does player 1 manage to get the updated hashMap? I would be very grateful if anyone can help with this as I have been unable to get the second player avatar to display on player 1 screen. Thanks in advance.

Leave a Reply

Your email address will not be published.