Jump to content

Making a Realtime Multiplayer Game with Phaser


Recommended Posts

When I started to play around with the Phaser API, I wanted to tackle the challenge of creating a realtime game with multiple players.  I decided to use the PubNub multiplayer framework for the realtime functionality and it worked extremely well.  I put my entire project up on Github and you can try it out by clicking HERE (open up two browser windows to test real time functionality).  PubNub provided me with low latency with message delivery happening in less than 250ms and Phaser is super lightweight which allows it to work in mobile browser and even on low end computers.  The entire project took me a few weeks to develop but most of that was just optimizing the game to send the least amount of messages possible.  I wrote a step by step tutorial if you want to try to make this yourself in Phaser, you can checkout the tutorial HERE.


Link to comment
Share on other sites

6 minutes ago, Nesh108 said:

Cool stuff but I can't help but wonder: is obvious advertising allowed in this section?

All of the code I wrote is open source and up on GitHub and I'm using the PubNub free tier.


2 hours ago, Skeptron said:

Is 250ms considered real-time? Congratz anyways on your achievment! Lots of people asking about real-time stuff here, hope they'll find answers in your tutorials :)

The messages are usually received in less than 50ms. Test out the real time functionality by opening up two browsers and trying yourself.  You can even play on your mobile device.  Also thanks for the kind words.

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...