O'Reilly logo

SFML Blueprints by Maxime Barbier

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying our game

To add this functionality to our game, we will need to rethink the internal structure a bit. First of all, we need to split our code to build two different programs. All the common classes (such as those used for communication) will be put into a common directory. All the other functionalities will be put into the server or client folder with respect to their usage. Let's start with the most complicated part: the server.

Server

The server will be in charge of all the simulation. In fact, all our game will reside in the server. Moreover, it will have to ensure the possibility of having multiple matches running at the same time. It will also have to deal with connections/disconnections and player events.

Because the server will not ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required