Multiplayer tutorial 3: pong

Index

Features on these Courses

Stats

12,175 visits, 50,875 views

Tools

This tutorial assumes you have already read both Multiplayer tutorial 1: concepts and Multiplayer tutorial 2: chat room.

The first tutorial covered the theory of how multiplayer games work and the way they need to be designed, using techniques like local input prediction and lag compensation. The second tutorial covered a practical example of a chat room, which dealt with practical use of signalling, connectivity and sending messages. This tutorial will now cover a simple case of synchronising objects in real-time for a 2-player multiplayer pong game. This is an advanced tutorial; if you are not already comfortable with your knowledge, consider revising the prior tutorials.

To get going, open the Example: Multiplayer - pong example that comes with Construct 2. This can be found in the Select template or example dialog that opens when pressing File - New. As with the previous tutorial, the project will be described event-by-event in more detail than the comments already in the project.

Running and testing

As with the chat example, the real-time game example must also be run from the first layout (F4), since it needs a valid name entered from the Login layout.

This example uses auto-joining rooms. As players join the game they are paired up in to games, since it only works with two players per game. This is described in more detail later. If you join the game you may find another person running the tutorial at the same time by chance; if not, or you cannot connect to them, try testing with a friend or just opening two browser windows side-by-side.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!