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 animations


In all our previous games, all the different entities displayed on the screen were static; at least they were not animated. For a more attractive game, the simplest thing to do is add some animations and different entities on the player. For us, this will be applied on the different buildings and warriors.

As we use a sprite-based game and not real-time animation based on bone movement, we need some textures with the animations that are already prepared. So, our textures will look as shown in the following figure:

Note

Note that the green grid is not a part of the image and is only shown here for information; the background is transparent in reality.

This type of texture is called a sprite sheet. In this example, the image can be split in two lines of four columns. Each line represents a direction of movement, namely left and right. Each cell of these lines represents a step of the future animation.

The aim of the work for this part is to be able to display a sprite using...

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