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

Building the game logic

We now have all the requirements to start our game: resource management, events management, GUI, animations, map, and the entity system. It's time for us to group them into a single project.

First, we need to create our entities. Thanks to the entity system previously described, we only need to build some components and their systems. We can build many of them, but the main components for the project are as follows:

Components

Entities

Skin

Animation

Health points

Current health

Maximum health

Team

Identifier for the team

Build area

The authorized range around the entity

Movement

Speed

Destination

Artificial intelligence for warriors

Delta time

Damage

Length of hit

The interesting ones are artificial intelligence ...

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