SFML Game Development By Example

Create and develop exciting games from start to finish using SFML

SFML Game Development By Example

This ebook is included in a Mapt subscription
Raimondas Pupius

8 customer reviews
Create and develop exciting games from start to finish using SFML
$10.00
$49.99
RRP $39.99
RRP $49.99
eBook
Print + eBook
Preview in Mapt

Book Details

ISBN 139781785287343
Paperback522 pages

Book Description

Simple and Fast Multimedia Library (SFML) is a simple interface comprising five modules, namely, the audio, graphics, network, system, and window modules, which help to develop cross-platform media applications. By utilizing the SFML library, you are provided with the ability to craft games quickly and easily, without going through an extensive learning curve. This effectively serves as a confidence booster, as well as a way to delve into the game development process itself, before having to worry about more advanced topics such as “rendering pipelines” or “shaders.”

With just an investment of moderate C++ knowledge, this book will guide you all the way through the journey of game development.

The book starts by building a clone of the classical snake game where you will learn how to open a window and render a basic sprite, write well-structured code to implement the design of the game, and use the AABB bounding box collision concept.

The next game is a simple platformer with enemies, obstacles and a few different stages. Here, we will be creating states that will provide custom application flow and explore the most common yet often overlooked design patterns used in game development.

Last but not the least, we will create a small RPG game where we will be using common game design patterns, multiple GUI. elements, advanced graphical features, and sounds and music features. We will also be implementing networking features that will allow other players to join and play together.

By the end of the book, you will be an expert in using the SFML library to its full potential.

Table of Contents

Chapter 1: It's Alive! It's Alive! – Setup and First Program
What is SFML?
SFML licensing
Resources and installation
Opening a window
Basics of SFML drawing
Drawing images in SFML
Common mistakes
Summary
Chapter 2: Give It Some Structure – Building the Game Framework
Graduating to ravioli
Implementing the window class
Building the game class
Hardware and execution time
Using the SFML clock
Fixed time-step
Common mistakes
Summary
Chapter 3: Get Your Hands Dirty – What You Need to Know
Introducing snake
Game design decisions
Implementing the snake structure
The snake class
The World class
Time to integrate
Hunting bugs
Fixing bugs
Going the extra mile
Common mistakes
Summary
Chapter 4: Grab That Joystick – Input and Event Management
Retrieving peripheral input
Introducing the event manager
Standard function wrapper
Building the event manager
Integrating the Event Manager class
Moving a sprite revisited
Principles of use
Common mistakes
Summary
Chapter 5: Can I Pause This? – Application States
What is a state?
The most simplistic approach
Introducing the state pattern
Improving the Event Manager class
Incorporating the state manager
Creating the intro state
The main menu state
A sample game state
The means to pause
Common mistakes
Summary
Chapter 6: Set It in Motion! – Animating and Moving around Your World
Use of copyrighted resources
Finding and using the current directory
Using the SFML views
Automated resource management
Introducing sprite sheets
Summary
Chapter 7: Rediscovering Fire – Common Game Design Elements
The game map
Building the game world
The parent of all world objects
Entity storage and management
Using entities to build characters
Adding enemies
Loading entities from the map file
Final editions to our code base
Summary
Chapter 8: The More You Know – Common Game Programming Patterns
Use of copyrighted resources
What is a programming pattern?
The entity component system
Managing entities
Designing the systems
Managing systems
Implementing the rendering system
Putting the ECS to work
The new and improved map
Summary
Chapter 9: A Breath of Fresh Air – Entity Component System Continued
Adding entity movement
Animating the entities
Handling collisions
Summary
Chapter 10: Can I Click This? – GUI Fundamentals
Use of copyrighted resources
What is a GUI?
Expansion of utility functions
Font management
The core of all elements
Defining GUI events
The interface class
Summary
Chapter 11: Don't Touch the Red Button! – Implementing the GUI
The GUI manager
The label element
The text field element
The scrollbar element
Integrating the GUI system
Expanding the event manager
Re-implementing the main menu
Summary
Chapter 12: Can You Hear Me Now? – Sound and Music
Use of copyrighted resources
Preparing the project for sound
Basics of SFML sound
Sound spatialization
Audio manager
Defining sound properties
Managing sounds
Adding support for sound
The sound emitter component
The sound listener component
Implementing the sound system
Integrating our code
Summary
Chapter 13: We Have Contact! – Networking Basics
Basics of networking
Letting the traffic flow
Multi-threading
Creating a simple communication protocol
Designing the client class
Implementing the client
The server class
Implementing server
A simple chat application
The chat client
Summary
Chapter 14: Come Play with Us! – Multiplayer Subtleties
Use of copyrighted resources
Shared code
Building our game server
Developing the game client
Summary

What You Will Learn

  • Create and open a window by using SFML
  • Utilize, manage, and apply all of the features and properties of the SFML library
  • Employ some basic game development techniques to make your game tick
  • Build your own code base to make your game more robust and flexible
  • Apply common game development and programming patterns to solve design problems
  • Handle your visual and auditory resources properly
  • Construct a robust system for user input and interfacing
  • Develop and provide networking capabilities to your game

Authors

Table of Contents

Chapter 1: It's Alive! It's Alive! – Setup and First Program
What is SFML?
SFML licensing
Resources and installation
Opening a window
Basics of SFML drawing
Drawing images in SFML
Common mistakes
Summary
Chapter 2: Give It Some Structure – Building the Game Framework
Graduating to ravioli
Implementing the window class
Building the game class
Hardware and execution time
Using the SFML clock
Fixed time-step
Common mistakes
Summary
Chapter 3: Get Your Hands Dirty – What You Need to Know
Introducing snake
Game design decisions
Implementing the snake structure
The snake class
The World class
Time to integrate
Hunting bugs
Fixing bugs
Going the extra mile
Common mistakes
Summary
Chapter 4: Grab That Joystick – Input and Event Management
Retrieving peripheral input
Introducing the event manager
Standard function wrapper
Building the event manager
Integrating the Event Manager class
Moving a sprite revisited
Principles of use
Common mistakes
Summary
Chapter 5: Can I Pause This? – Application States
What is a state?
The most simplistic approach
Introducing the state pattern
Improving the Event Manager class
Incorporating the state manager
Creating the intro state
The main menu state
A sample game state
The means to pause
Common mistakes
Summary
Chapter 6: Set It in Motion! – Animating and Moving around Your World
Use of copyrighted resources
Finding and using the current directory
Using the SFML views
Automated resource management
Introducing sprite sheets
Summary
Chapter 7: Rediscovering Fire – Common Game Design Elements
The game map
Building the game world
The parent of all world objects
Entity storage and management
Using entities to build characters
Adding enemies
Loading entities from the map file
Final editions to our code base
Summary
Chapter 8: The More You Know – Common Game Programming Patterns
Use of copyrighted resources
What is a programming pattern?
The entity component system
Managing entities
Designing the systems
Managing systems
Implementing the rendering system
Putting the ECS to work
The new and improved map
Summary
Chapter 9: A Breath of Fresh Air – Entity Component System Continued
Adding entity movement
Animating the entities
Handling collisions
Summary
Chapter 10: Can I Click This? – GUI Fundamentals
Use of copyrighted resources
What is a GUI?
Expansion of utility functions
Font management
The core of all elements
Defining GUI events
The interface class
Summary
Chapter 11: Don't Touch the Red Button! – Implementing the GUI
The GUI manager
The label element
The text field element
The scrollbar element
Integrating the GUI system
Expanding the event manager
Re-implementing the main menu
Summary
Chapter 12: Can You Hear Me Now? – Sound and Music
Use of copyrighted resources
Preparing the project for sound
Basics of SFML sound
Sound spatialization
Audio manager
Defining sound properties
Managing sounds
Adding support for sound
The sound emitter component
The sound listener component
Implementing the sound system
Integrating our code
Summary
Chapter 13: We Have Contact! – Networking Basics
Basics of networking
Letting the traffic flow
Multi-threading
Creating a simple communication protocol
Designing the client class
Implementing the client
The server class
Implementing server
A simple chat application
The chat client
Summary
Chapter 14: Come Play with Us! – Multiplayer Subtleties
Use of copyrighted resources
Shared code
Building our game server
Developing the game client
Summary

Book Details

ISBN 139781785287343
Paperback522 pages
Read More
From 8 reviews

Read More Reviews