Book Image

SFML Game Development

By : Artur Moreira, Henrik Vogelius Hansson, Jan Haller, Henrik Valter Vogelius, SFML
Book Image

SFML Game Development

By: Artur Moreira, Henrik Vogelius Hansson, Jan Haller, Henrik Valter Vogelius, SFML

Overview of this book

Game development comprises the combination of many different aspects such as game logics, graphics, audio, user input, physics and much more. SFML is an Open Source C++ library designed to make game development more accessible, exposing multimedia components to the user through a simple, yet powerful interface. If you are a C++ programmer with a stack of ideas in your head and seeking a platform for implementation, your search ends here.Starting with nothing more than a blank screen, SFML Game Development will provide you with all the guidance you need to create your first fully featured 2D game using SFML 2.0. By the end, you'll have learned the basic principles of game development, including advanced topics such as how to network your game, how to utilize particle systems and much more.SFML Game Development starts with an overview of windows, graphics, and user inputs. After this brief introduction, you will start to get to grips with SFML by building up a world of different game objects, and implementing more and more gameplay features. Eventually, you'll be handling advanced visual effects, audio effects and network programming like an old pro. New concepts are discussed, while the code steadily develops.SFML Game Development will get you started with animations, particle effects and shaders. As well as these fundamental game aspects, we're also covering network programming to the extent where you'll be able to support the game running from two different machines. The most important part, the gameplay implementation with enemies and missiles, will make up the core of our top-scrolling airplane shoot' em-up game!You will learn everything you need in SFML Game Development in order to start with game development and come closer to creating your own game.
Table of Contents (18 chapters)
SFML Game Development
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


We had to cover a lot of ground in this chapter. We have explained the most basic concepts that are required to create a game; concepts that you should always have present in order to save yourself from losing time in such issues, and instead, focus on making a great game.

In this chapter we:

  • Learned what SFML is, and what functionality it provides

  • Listened to input, and moved the player over several frames

  • Rendered an image to the screen

  • Learned about game loops and delta times, and saw the strengths and weaknesses of different approaches to handle time steps.

And if you are interested in how you would measure your FPS and render that to the screen, then have a look at the code base. We have implemented that functionality there, and it is based on the subjects we have already covered. We would recommend you try yourself; the only things you need are sf::Text and sf::Font in order to render text on the screen. You can learn more about these classes in SFML's API documentation at www.sfml-dev.org.

This concludes our introduction chapter. From now on we are going to investigate different aspects of SFML and game development in a more detailed manner. In the next chapter, we start with resource handling, which explains the backgrounds behind textures, fonts, and other resources.