SFML Game Development by Example Create and Develop Exciting Games From Start To Finish Using SFML Pupius
SFML Game Development by Example Create and Develop Exciting Games From Start To Finish Using SFML Pupius
https://ebookfinal.com/download/chained-exploits-advanced-hacking-
attacks-from-start-to-finish-1st-edition-andrew-whitaker/
https://ebookfinal.com/download/xna-4-0-game-development-by-example-
beginner-s-guide-visual-basic-edition-kurt-jaegers/
https://ebookfinal.com/download/3d-game-textures-create-professional-
game-art-using-photoshop-3rd-edition-luke-ahearn/
https://ebookfinal.com/download/exploratory-multivariate-analysis-by-
example-using-r-second-edition-husson/
Creating Games with Unity and Maya How to Develop Fun and
Marketable 3D Games 1st Edition Adam Watkins
https://ebookfinal.com/download/creating-games-with-unity-and-maya-
how-to-develop-fun-and-marketable-3d-games-1st-edition-adam-watkins/
https://ebookfinal.com/download/information-theory-and-coding-by-
example-kelbert-mark/
SFML game development by example create and develop
exciting games from start to finish using SFML Pupius
Digital Instant Download
Author(s): Pupius, Raimondas
ISBN(s): 9781785287343, 1785287346
Edition: Online-Ausg
File Details: PDF, 3.21 MB
Year: 2015
Language: english
SFML Game Development
By Example
Raimondas Pupius
BIRMINGHAM - MUMBAI
SFML Game Development By Example
All rights reserved. No part of this book may be reproduced, stored in a retrieval
system, or transmitted in any form or by any means, without the prior written
permission of the publisher, except in the case of brief quotations embedded in
critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the
companies and products mentioned in this book by the appropriate use of capitals.
However, Packt Publishing cannot guarantee the accuracy of this information.
ISBN 978-1-78528-734-3
www.packtpub.com
Credits
Reviewers Proofreader
Tom Ivanyo Safis Editing
Vittorio Romeo
Richa Sachdeva Indexer
Priya Sane
Commissioning Editor
Dipika Gaonkar Graphics
Kirk D'Penha
Acquisition Editors
Prachi Bisht Production Coordinator
Aparna Bhagat
Usha Iyer
Cover Work
Content Development Editor
Aparna Bhagat
Mamata Walker
Technical Editor
Pramod Kumavat
Copy Editors
Ting Baker
Kevin McGowan
About the Author
His other interests include web development, which was his primary interest before
game development, music, and linguistics.
Tom Ivanyo is an aspiring game and software developer. After learning Visual
Basic, he picked up several other languages, from Assembly to C#. Currently, he is
working as a software developer and spending his free time creating games along
with his friend, Doug Madden. Together, they started their small gaming studio
named S2D Games (http://s2dgames.com).
Did you know that Packt offers eBook versions of every book published, with PDF
and ePub files available? You can upgrade to the eBook version at www.PacktPub.com
and as a print book customer, you are entitled to a discount on the eBook copy. Get in
touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign
up for a range of free newsletters and receive exclusive discounts and offers on Packt
books and eBooks.
TM
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital
book library. Here, you can search, access, and read Packt's entire library of books.
Why subscribe?
• Fully searchable across every book published by Packt
• Copy and paste, print, and bookmark content
• On demand and accessible via a web browser
[i]
Table of Contents
[ ii ]
Table of Contents
[ iii ]
Table of Contents
[ iv ]
Table of Contents
[v]
Table of Contents
[ vi ]
Table of Contents
[ vii ]
Preface
Preface
Game development is one of the most interesting career choices to date. Apart from
the many other fields that are incorporated in this process, it's also a realm where
pure imagination comes to life. Even during the times when one may think that
there's nothing new under the sun, ground-breaking ideas are still cemented in this
medium, both as revolutionary milestones and exciting adventures that will make
us feel child-like excitement yet again.
Getting started with game programming is easier now than ever before!
Documentation and tutorials aside, there even exist enthusiasts out there who
actually put together libraries of code that can be used to eliminate the redundant
or difficult parts of building different types of applications. As it so happens, one
of these libraries is titled "Simple and Fast Multimedia Library", and it is the focal
point of this publication.
Throughout the course of this book, three projects are built from scratch, with each
one having increased complexity compared to its preceding project. We will start
with a basic clone of the classical arcade game—Snake, which introduces the basics
of SFML and some of the framework that is going to persist until the very end. As
difficult subjects are addressed, we will begin to cobble the second project together,
turning it into a side-scrolling platformer. The remaining chapters of this book focus
on building and polishing an online RPG-style game that can be played with your
friends! No detail of any of these projects will remain undiscussed, as you will be
guided through the entire process of planning and implementing every single
aspect of these projects.
If the vast array of features that need to be worked on hasn't scared you away yet,
congratulations! You are about to embark on a journey of tremendous proportions.
So don't let the odds intimidate you. We hope to see you at the finish line!
[ ix ]
Preface
Chapter 2, Give It Some Structure – Building the Game Framework, introduces a better
framework for the applications that will be used throughout the book. It also covers
the basics of timing in video games.
Chapter 3, Get Your Hands Dirty – What You Need to Know, helps solidify all the
information from the previous chapters by finishing our first game project.
Chapter 4, Grab That Joystick – Input and Event Management, elaborates on the process
of obtaining a window event and peripheral information as well as using it in an
automated way.
Chapter 5, Can I Pause This? – Application States, addresses the issue of state switching
and blending using a state machine.
Chapter 6, Set It in Motion! – Animating and Moving around Your World, deals with
the issues of screen scrolling and resource management as well as the usage and
animation of sprite sheets.
Chapter 7, Rediscovering Fire – Common Game Design Elements, wraps up the second
project of the book by dealing with entity management, tile-maps, and collision.
Chapter 8, The More You Know – Common Game Programming Patterns, introduces
the third project of the book by covering the fundamentals of a few common
programming patterns, including the entity component system.
Chapter 10, Can I Click This? – GUI Fundamentals, breaks down how a graphical user
interface can be implemented using the fundamental data types.
Chapter 11, Don't Touch the Red Button! – Implementing the GUI, picks up where the
previous chapter left off and wraps up the implementation of a GUI system. We
also discuss three basic element types.
Chapter 12, Can You Hear Me Now? – Sound and Music, livens up the third project of
the book by bringing entity sounds and music to the table.
[x]
Preface
Chapter 13, We Have Contact! – Networking Basics, covers all the basics that are
required in order to implement networking in our final project.
Chapter 14, Come Play with Us! – Multiplayer Subtleties, transforms the final project
of the book into a multiplayer RPG-style death match with the application of a
client-server network model as well as a combat system.
Conventions
In this book, you will find a number of text styles that distinguish between different
kinds of information. Here are some examples of these styles and an explanation of
their meaning.
Code words in text, database table names, folder names, filenames, file extensions,
pathnames, dummy URLs, user input, and Twitter handles are shown as follows:
"We can include other contexts through the use of the include directive."
[ xi ]
Preface
When we wish to draw your attention to a particular part of a code block, the
relevant lines or items are set in bold:
#include <SFML/Graphics.hpp>
New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this: "Navigate
to the VC++ Directories underneath Configuration Properties by right clicking on
our project and selecting Properties."
Reader feedback
Feedback from our readers is always welcome. Let us know what you think about
this book—what you liked or disliked. Reader feedback is important for us as it
helps us develop titles that you will really get the most out of.
If there is a topic that you have expertise in and you are interested in either writing
or contributing to a book, see our author guide at www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things to
help you to get the most from your purchase.
[ xii ]
Preface
Errata
Although we have taken every care to ensure the accuracy of our content, mistakes
do happen. If you find a mistake in one of our books—maybe a mistake in the text or
the code—we would be grateful if you could report this to us. By doing so, you can
save other readers from frustration and help us improve subsequent versions of this
book. If you find any errata, please report them by visiting http://www.packtpub.
com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your
submission will be accepted and the errata will be uploaded to our website or added
to any list of existing errata under the Errata section of that title.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very seriously.
If you come across any illegal copies of our works in any form on the Internet, please
provide us with the location address or website name immediately so that we can
pursue a remedy.
We appreciate your help in protecting our authors and our ability to bring you
valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at
[email protected], and we will do our best to address the problem.
[ xiii ]
Discovering Diverse Content Through
Random Scribd Documents
—Si vous me donnez votre parole de les dégager dans huit jours
et de me les rapporter, mais une parole formelle, Dieu sait,
emportez-les.... Vous en retirerez certainement dix douros, car l’une
d’elles a un brillant qui donne la cataracte rien qu’à le regarder.»
Elles n’en dirent pas davantage. Elles fermèrent soigneusement
la porte, pour que personne ne pût les voir du couloir. Si quelqu’un
avait pu écouter, il n’aurait entendu qu’ouvrir et fermer un tiroir de la
commode, un chuchotement de Benina et une gargouillade de
l’autre.
XXI
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookfinal.com