Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
SFML Blueprints

You're reading from   SFML Blueprints Sharpen your game development skills and improve your C++ and SFML knowledge with five exciting projects

Arrow left icon
Product type Paperback
Published in May 2015
Publisher Packt
ISBN-13 9781784398477
Length 298 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Toc

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 (to damage) and movement. The others are pretty naive. Of course, you can create your own component in addition/replacement of those proposed.

Building our components

We know all the data needed by our components, so let's build the two interesting...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at AU $24.99/month. Cancel anytime