PC Games

Orb
Lasagne Monsters
Three Guys Apocalypse
Water Closet
Blob Wars : Attrition
The Legend of Edgar
TBFTSS: The Pandoran War
Three Guys
Blob Wars : Blob and Conquer
Blob Wars : Metal Blob Solid
Project: Starfighter
TANX Squadron

Android Games

DDDDD
Number Blocks
Match 3 Warriors

Tutorials

2D shoot 'em up
2D top-down shooter
2D platform game
Sprite atlas tutorial
Working with TTF fonts
2D adventure game
Widget tutorial
2D shoot 'em up sequel
2D run and gun
Roguelike
Medals (Achievements)
2D turn-based strategy game
2D isometric game
SDL 1 tutorials (outdated)

Latest Updates

SDL2 isometric tutorial
Sun, 24th July 2022

SDL2 turn-based strategy tutorial
Thu, 14th April 2022

Water Closet ported to PlayStation Vita
Tue, 4th January 2022

The Legend of Edgar 1.35
Sat, 1st January 2022

Achievements tutorial
Thu, 2nd December 2021

All Updates »

Tags

android (3)
battle-for-the-solar-system (9)
blob-wars (9)
brexit (1)
code (6)
edgar (7)
games (39)
lasagne-monsters (1)
making-of (5)
match3 (1)
numberblocksonline (1)
orb (2)
site (1)
tanx (4)
three-guys (3)
three-guys-apocalypse (3)
tutorials (11)
water-closet (4)

Books


A North-South Divide

For over a hundred years, messenger Duncan has wandered the world, searching for the missing pieces of an amulet that will rid him of his curse; a curse that has burdened him with an extreme intolerance of the cold, an unnaturally long life, and the despair of watching all he knew and loved become lost to the ravages of time. But now, Duncan is close to the end of his long quest.

Click here to learn more and read an extract!

SDL2 Game Tutorials

Overview

This series of tutorials focuses on creating games using SDL2. The tutorials are split into several parts, to make it easier to understand the steps involved and not to overload the reader with information from the start.

Note: These tutorials assume that you are already familiar with C programming and you are comfortable with advanced topics such as pointers, as well as using Makefiles. You are also advised to follow the tutorials in order, rather than just jumping around as prior knowledge is assumed throughout. You can read more about setting up SDL2 on the API's wiki page: https://wiki.libsdl.org/Installation.

The SDL1 tutorials have moved here. Since these use SDL 1, they are considered out of date and it is suggested you use the SDL 2 tutorials instead.

Purchase

The full source code and assets for all the listed tutorials is available for purchase.

From itch.io

You may purchase the complete set of tutorials from itch.io, using the link below.

Directly

It is recommended that you purchase the tutorials from itch.io. However, if you do not wish to create an itch.io account, you can purchase the tutorial bundle directly from this website. If you wish to do so this way, use the PayPal button below. Once your payment has been approved by PayPal, enter either your email address or the transaction id from the PayPal receipt into the download form below, to download the tutorials.

SDL2_Tutorials.tar.gz 59.01MB 24th July 2022

Click here to see the list of files in the archive

There would usually be a PayPal button here to click on, but direct purchases are not available at the moment. Please check back later, or buy from itch.io instead.

Download

If you've already paid, you can use the form below to download the tutorials by entering your email address or PayPal transaction id, and clicking Download. If you have any trouble, please contact info@parallelrealities.co.uk.

Other

You can also download some of the games created by these tutorials by clicking here.

Creating a 2D shoot 'em up

This tutorial will show how to create a simple 2D shoot 'em up, starting with opening a window, all the way to building a highscore table. If you're new to SDL2, this would be a good place to start.

  1. Opening a window
  2. Drawing the player
  3. Moving the player
  4. Firing
  5. Refactoring
  6. Enemies
  7. Shooting enemies
  8. Enemies fighting back!
  9. Effects and background graphics
  10. Sound and music
  11. Bitmap fonts and scoring
  12. Score pods
  13. Highscore table (Part 1)
  14. Highscore table (Part 2)
  15. Title screen and finishing touches

Creating a 2D top-down shooter

This tutorial will show how to create a simple top-down 2D shooter that we're going to call Battle Arena Donk! Mouse controls will be used extensively throughout.

  1. Reading the mouse
  2. Angles and rotation
  3. Mouse buttons and shooting
  4. Battling enemies
  5. Scrolling the arena
  6. Finishing touches

Creating a 2D platformer

Learn how to create a simple multi-scrolling 2D platformer, code-named Pete's Pizza Party.

  1. Loading and displaying the map
  2. Scrolling the map
  3. Controlling the character
  4. Interacting with entities
  5. Moving platforms
  6. Finishing touches

Creating a sprite atlas

In this tutorial, we'll demonstrate how to create and use a sprite atlas.

  1. Preparing the files
  2. Creating the atlas texture
  3. Creating the atlas meta data
  4. Using the atlas with SDL2
  5. Rotating, scaling, blending, and colour modulation

Working with TTF fonts

In this tutorial, we'll demonstrate how to use SDL2 TTF for text rendering.

  1. Basic font rendering
  2. Creating a glyph atlas
  3. Wrapping, aligning, and typewriter effect
  4. Unicode support

Creating a simple 2D adventure game

Learn how to make a basic 2D adventure game.

  1. Movement and map rendering
  2. Map scrolling and collisions
  3. Loading a map
  4. Entity interactions, part 1
  5. Inventory management
  6. Entity interactions, part 2
  7. Fog of war
  8. Message boxes
  9. Loading the dungeon
  10. The Grumpy Goblin
  11. The Cursed Maze
  12. Vampire Bats!
  13. The Escape Room
  14. Finishing touches

Creating a basic widget system

Learn how to make a widget system, for use with in-game menus.

  1. Basic non-functional menu
  2. Actionable menu
  3. Loading a widget set
  4. Select widget
  5. Slider widget
  6. Text input widget
  7. Control widget
  8. In-game menu
  9. Widget groups

Creating a 2D vertical shoot 'em up

Learn how to create a vertical 2D shoot 'em up, that includes power-ups and enemy attack patterns.

  1. Setting up
  2. Enemy attack patterns (first sequence)
  3. Power-ups
  4. Return fire!
  5. Enemy attack patterns (full sequence)
  6. Bosses
  7. More power-ups
  8. Enemy attack patterns (final sequence)
  9. Finishing touches

Creating a 2D run and gun game

Learn how to create a 2D run and gun game, like Contra, Turrican, and Duke Nukem.

  1. First steps
  2. Aiming, shooting, and ducking
  3. Destroying targets
  4. Enemies
  5. Basic map
  6. Gameplay tweaks
  7. Larger, scrolling map
  8. Player health + power-ups
  9. Keycards, doors, and other solid entities
  10. Adding a quadtree
  11. More gameplay tweaks
  12. Player death + effects
  13. A full level!
  14. Game controller support
  15. Finishing touches

Creating a roguelike

Learn how to create a simple roguelike.

  1. Map generation
  2. First monster
  3. Combat
  4. Adding the HUD
  5. Monsters attacking!
  6. A* Pathfinding
  7. Items and inventory display
  8. Using items
  9. Equipping items
  10. Comparing stats
  11. XP and levelling
  12. Stairs
  13. More monsters, more loot!
  14. Doors
  15. Death and Highscores
  16. Status effects
  17. Saving
  18. Loading
  19. The Mouse King
  20. Finishing touches

Creating a lookup system

A short tutorial on how to make a key-value lookup system.

  1. Creating a lookup system

Creating an in-game achievement system

Learn how to create an achievement system, known as Medals.

  1. Unlocking Medals
  2. Integrating with gameplay
  3. Saving progress
  4. A full game!
  5. Online functionality
  6. Threading

Creating a simple 2D turn-based strategy game

A tutorial about how to create a 2D turn-based strategy game.

  1. Basic unit control
  2. Controlling multiple units
  3. Limiting movement
  4. AP (action point) handling
  5. Enemies and simple AI
  6. Combat #1: Player attacking
  7. Combat #2: Weapons, accuracy, and damage
  8. Combat #3: Feedback and effects
  9. Combat #4: Line of sight
  10. Combat #5: AI attacking
  11. Handling player death
  12. Item handling
  13. Adding the camera
  14. Expanding the HUD
  15. Map generation
  16. Slime pools
  17. Lilac Ghost
  18. Blue Ghost
  19. Red Ghost
  20. Green Ghost
  21. Winning and losing
  22. Smooth camera
  23. Threaded map generation
  24. Finishing touches

Making a 2D isometric game

A tutorial about how to create a 2D isometric game, in an old-school flip-screen style.

  1. Drawing tiles
  2. Selecting tiles
  3. Adding entities
  4. Adding Purple Guy
  5. Walls and trees
  6. Occlusion testing
  7. Loading and traversing the map
  8. Entities and items
  9. Buttons and bridges
  10. Simple lighting
  11. Mini map
  12. Finishing touches

Downloads

Binary downloads (Linux + Windows) for some of the tutorials included here:

Mobile site