SDL2 Game Tutorials
A downloadable asset pack
A collection of SDL2 tutorials, from Parallel Realities.
https://www.parallelrealities.co.uk/tutorials
This archive contains the following tutorials:
* 2D shoot 'em up tutorial (3)
* 2D top-down shooter tutorial
* 2D platformer tutorial
* Sprite atlas tutorial
* TTF font tutorial
* 2D adventure tutorial
* Widgets tutorial
* 2D vertical shoot 'em up tutorial
* 2D run-and-gun tutorial
* Rogue-like tutorial
* Achievements tutorial
* 2D strategy game tutorial
* 2D isometric game tutorial
* 2D map editor tutorial
* 2D santa game
*2D split screen game
You can preview the list of files in the archive by following the link below:
https://www.parallelrealities.co.uk/downloads/tutorials/sdl2/SDL2_Tutorials.txt
===
The source code to the unfinished games: Lasagne Monsters, 3 Guys Apocalypse, and the RPG Orb is available to those who are willing to pay a bit more. See the project pages for those below:
https://parallelrealities.itch.io/lasagne-monsters
Updated | 28 days ago |
Status | In development |
Category | Assets |
Rating | Rated 5.0 out of 5 stars (6 total ratings) |
Author | Parallel Realities |
Tags | sourcecode, Tutorial |
Purchase
In order to download this asset pack you must purchase it at or above the minimum price of $12.99 USD. You will get access to the following files:
Development log
- Minor compile fixes28 days ago
- Split screen game tutorial addedMar 20, 2024
- SDL2 Santa added!Nov 23, 2023
- Compile fixes.Feb 14, 2023
- SDL2 Shooter 3 added!Feb 13, 2023
- Medals tutorial addedDec 05, 2021
- PPP tutorial bug fix.Sep 06, 2021
Comments
Log in with itch.io to leave a comment.
Which of these tutorials do you feel has the most flexible or well implemented entity system / architecture?
Many of the tutorials support an entity system, where entities can be created by name, and can interact with each other. They do this using an entity factory (entityFactory.c), which sets them up and defines their behaviours via their init calls. They then interact with each other via a call that processes them each frame (usually in entities.c, in a call called doEntities).
The most basic one is Adventure, where only the player interacts with other entities. It's also turned based, so things only interact as the player moves about.
Both Santa and Gunner support a real time system, where entities can all interact with one another.
Rogue is the most complex, since it supports saving and loading, which means the entity states must be preserved and set back up again.
Could you create a tutorial for creating a table top card game using SDL2?
I guess you means something like Balatro? I've no experience with making such games, so it's not something I would attempt to write a tutorial for. I think the biggest challenge would be implementing the rules (of which there could be dozens). Also, one would need to teach the AI such rules, and ensure it was able to play fairly. Not a simple game to make, unfortunately!
Thank you very much!
Excited to learn from such a talented dude
Sorry to hear you're not getting on well with the tutorials, however the page does state that they are not intended for those who are new to programming, and that familiarity with the C language, as well as tools such as CMake and Makefiles, are prerequisites.
Hi! I ran CmakeLists as it says in tutorial, but encountered
-- Checking for one of the modules 'sdl2'
CMake Error at C:/Program Files/CMake/share/cmake-3.29/Modules/FindPkgConfig.cmake:927 (message):
None of the required 'sdl2' found
Call Stack (most recent call first):
CMakeLists.txt:5 (pkg_search_module)
Is there any specific path that I need to put my SDL libraries?
for me it's impossible to go through this.. Is there any way that I can get git address? I have no idea what to do with this cmake
Please email info@parallelrealities.co.uk. It'll be easier to help you over email.
Great tutorials, clear, succinct and not junked with redundant details. It would be cool if you really would do a tutorial about a multiplayer game and even a basic 3D game from scratch using vertices to describe faces of polygons and based on that construct the 3D scene ( similar to how OpenGL's pipeline works )
Yo if you made a tutorial on the following topics:
Networked Hack n Slash (melee) pvp game (Client and Server)
Networked cosmetic and achievment (an embedable sdk for access to the server and the server program)
No one has made a tutorial for these topics before so it would be great if you did. I would probably pay 15-20 dollars if you added these, since I am a beginner in networking and multiplayer game programming,
Edit: You could also try and make a framework/engine with common structs and wrappers (for network, drawing, input, etc) for future tutorials to make things easier for beginners.
What is the licensing for this source code and your tutorials? Can I use the source code here or tutorials on your website as the basis for my own projects regardless of their own licenses?
The code is governed under standard copyright laws, so while you could use it as a basis for your own work (kind of expected, to be fair), you couldn't release that code or re-license it.
So, you wouldn't be able to create a GPL project, for example, and post that publicly.
Many thanks to the author for this tutorial.
Hello. Asset pack has only 10 games. Is it ok?
UPD: The problem was on my side
The asset pack contains the source code and assets for all the tutorials listed here:
https://www.parallelrealities.co.uk/tutorials
So, that would be:
2D shoot 'em up tutorial
2D top-down shooter tutorial
2D platformer tutorial
2D adventure tutorial
2D vertical shoot 'em up tutorial
2D run and gun tutorial
Roguelike tutorial
Medals (Achievements) tutorial
2D turn based strategy tutorial
2D isometric game tutorial
Mission-based 2D shoot 'em up tutorial
Sprite atlas tutorial
Working with TTF fonts
Widget tutorial
Lookups
Map editor tutorial
They are all divided up into their individual parts, too.
A new tutorial is being added tomorrow, one that will show the reader how to create a simple Santa Claus game.
The downloaded pack contains the following directories:
adventure/
atlas/
bad/
isometric/
mapEditor/
medals/
sdl2Rogue/
sdl2Shooter2/
sdl2Shooter3/
widgets/
There seems to be something missing here
UPD: I got this error when unziping the pack: "truncated gzip input"
What platform are you on? What tool are you using for extracting the archive?
Maybe try a different extraction tool if you're on Windows?
Also, try downloading the file again.
That truncation error could be a result of the download not having completed properly.
Thank you for help. The problem was on my side :)
I bought this after going through lots of online tutorials. I wish I had started here. These tutorials are easy to understand and have plenty of content. I've already compiled all the final projects to ensure they work (they all do) and then started the lessons. I got through 7 in 2 days just in my free time. They are very clear and being able to work from functioning source code makes it easier to understand.
These are great.
Hello. Besides getting the complete source code, what are the differences between buying these tutorials and following them on your website?
The source code contains everything that is needed to build and run each part, of each tutorial. It includes all the assets (data, music, sound, etc) that are needed.
One could work through the tutorials on the site, and copy the code from there in your own project, but you may find it much harder to work with than having the complete source available, that can be built and run using cmake.
SDL2 Shooter 3 is a great example of where having access to the complete source is a boon, as that tutorial is massive!
Tutorials are fantastic. Thanks for making these!
100% worth every penny. I've been programming for years and sometimes it's just nice to see how other people approach things, to come up with new ideas. Be it games, web apps, etc. But not just bits and pieces, the entire thing. Great stuff!
Just what I was looking for, written tutorials (not videos that are hard to reference later) in as close to bare metal programming as you can get with SDL2 and in my preferred language C.
Love that there is a variety of project types and more are being added, (especially interested in the 2D strategy game).
Great work and thank you for providing this for people interested in low level game programming.
Just skimmed through some of the source and am very happy with the purchase. Looking forward to going through these!
Doing this in C++. As Parallel said, it's easy to follow along. It's also great practice in "transposing" the code from C to C++.
Excellent purchase!
is it possible to follow along with C++? These tutorials look really insightful but I only have experience with writing cpp and c#.
If you understand C++ then you won't have any trouble understanding these tutorials; C++ was originally developed as an extension to C, so they were both very similar languages.
Thanks for the reply! Just purchased your tutorials and making my way through them now. Really great stuff!
This is the best game dev course related to C/SDL! Glad I found it
I just bought it today. The only updated tutorial on C & SDL2 game development. Thank you very much!
Thank you for including your new Map Editor tutorial!
No problem. I've been making little map editors for my own games for a few years, so I thought I'd demonstrate how I go about it. It' s only a little thing, but hopefully some will find it useful / insightful.
can u do a character creator tutorial?
Ah, I only write about stuff I have experience with, I'm afraid.
I wanted to thank you for sharing your knowledge and experience. Actually, I'm a web developer, but something I wanted to learn for a long time was to develop games in C. It will be a long learning process for me, but it is quite enjoyable. I would recommend to friends who buy this learning kit to progress slowly, it can be supported by learning openGL at the same time. If you are interested in these technologies, I highly recommend this course. These courses will also help you learn how algorithms and data structures (For Example Linked List) work. Have a nice day.
I highly reccomend those tutorials, best money spend since long time
i agree
These are the missing SDL2 tutorials that the world needed. Thanks!
These are nice. Reminds me of the old magazine-listing days!
Btw, there's a memory corruption bug in the platformer tutorial. On my mac it was causing all rendering to fail with "Invalid renderer" messages. In map.c:
static SDL_Texture *tiles[MAX_TILES];
should read:
static SDL_Texture *tiles[MAX_TILES+1];
Thanks! Nice spot. I've updated the PPP tutorial to fix this. The code is now:
defs.h:
map.c:
That should all work now (unless I've somehow introduced another bug somehow..!)
These tutorials have been better than any other I can find for C/SDL2. Almost every other SDL tutorials I could find were either outdated, using C++, or just sort of half-baked. They're structured in an easy to understand way, and the code itself is structured in a way that's easy to understand/modify and play with on you own. Absolutely awesome, thanks so much!
If you’re a starting C language and want to learn how to develop games using SDL2, then I would highly recommend this tutorial series. They are a great introduction into programming in C and using the many features of SDL2. They hold your hand, but also force you to look at the source code to learn what’s going on under the hood. If you’re like me and re-write what the author writes it will help solidify a lot of the concepts. You can even mod the tutorials for extra practice.
Best $5 (or more) you can spend with regard to learning SDL2.
Thank you!