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 application

Now that we have all the information required to build our game, let's start to change it. The first step is to change our world to a Euclidean torus with a fixed size. Here is a representation of a torus taken from the Wikipedia page:

Modifying our application

To do this, we will need some information from inside the game, such as the world size. We will add the information inside the Game class as two integer values, height and width:

const int _x, const _y;

We will initialize them with the constructor. So now, we need parameters for this class:

Game(int x=800, int y=600);

We will need to change our constructor implementation a bit, as shown in the ...

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