Creating Games From Scratch Using SDL 2.0
2.7 (9 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
68 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Creating Games From Scratch Using SDL 2.0 to your Wishlist.

Add to Wishlist

Creating Games From Scratch Using SDL 2.0

Create your own games from beginning to end on popular, crossplatform, SDL 2.0
2.7 (9 ratings)
Instead of using a simple lifetime average, Udemy calculates a course's star rating by considering a number of different factors such as the number of ratings, the age of ratings, and the likelihood of fraudulent ratings.
68 students enrolled
Created by William Sherif
Last updated 12/2016
English
Current price: $10 Original price: $20 Discount: 50% off
5 hours left at this price!
30-Day Money-Back Guarantee
Includes:
  • 1.5 hours on-demand video
  • 4 Articles
  • 1 Supplemental Resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
What Will I Learn?
  • Program your own 2d games using SDL 2.0
  • Understand the discrete nature of games and the "game loop"
  • Play sfx & music in your game
  • Do body body collision detection and resolution
View Curriculum
Requirements
  • To be able to follow this course, you will need an intermediate skill level with coding in C++
  • You will need an IDE in your chosen development environment (On Windows, usually Visual Studio, Mac=Xcode)
  • You will need to download SDL 2.0 from http://libsdl.org (free & open source)
Description

Have you ever wanted to program your own game in C++ from scratch? Do you want to enjoy easy & free multiplatform deployment (Windows, Mac, Linux iOS and Android?). In this course, we will have a basic introduction to programming games in C++ using the SDL 2.0 library. We will use SDL 2.0 to:

  • Get a window on the screen
  • Draw line and rectangle primitives
  • Draw sprites on the screen
  • Use object-oriented principles to manage Sprites and game character data
  • Load and play sounds & music from disk
  • Do collision detection using Rectangles
  • Manage game state & game state transitions using finite state machines

Overview & Motivation

Why use SDL 2.0? Many people opt to go with complete game engines, such as Unity or Unreal Engine 4, to create their games. Unity and Unreal have licensing costs associated with them. Are you prepared to take on that extra cost? What if you can avoid spending that money on the engine and spend it on licensing assets and other resources instead?

What about using a free and open source sound, graphics and input API to deploy your game to all devices? And the freedom to program in pure C or C++?

LibSDL lets you do all that. Simple C commands will enable you to load sounds & music, load & display hardware accelerated graphics easily. The simple framework I provide in the code examples here will make it easy for you to get started creating your own games from scratch.

Programming from C++ directly (instead of using an engine) will give you much more control over how things get done inside your game. If you like raw programming and always wanted to see how games like Super Mario Brothers, Dragon Warrior, and other classic NES games would get assembled, try this course!

Many professional & indie games use libsdl already, including:

Robin hood - the Legend of Sherwood, Left 4 Dead 2, Steel Storm, Edna & Harvey, Proteus, Psychonauts, Amnesia, FastForward, Syberia, AwesomeNauts and more.

Who is the target audience?
  • This course is not about creating robust game engines!
  • We will see some typical engine code (collision detection code), but our focus is on game assembly using SDL
  • This game is not about creating game art.. that princess is in another castle!
  • If you're interested in interfacing with SDL 2.0 directly (with no other layers between!) this course is for you
  • Our core focus in this course will be creating games using SDL
Students Who Viewed This Course Also Viewed
Curriculum For This Course
24 Lectures
01:27:05
+
Who uses SDL anyway?
2 Lectures 04:55
+
Structure of a Game
3 Lectures 09:36
Game software is complex!
04:13

while( true ) { update(); draw(); }
Game loop
03:18

The discreteness of the game loop
02:05
+
Setting up SDL
5 Lectures 29:13
SDL sample program
03:26

Installing SDL 2.0 on Windows
05:02

Installing SDL 2.0 on Mac OS X
08:29

[Part 1/2] SDL 2.0 Barebones Bootstrap/Starter Explained (SDL_Init())
09:23

[Part 2/2] SDL 2.0 Barebones Bootstrap/Starter Explained (draw function)
02:53
+
Basic Sprites
8 Lectures 25:32
This is a Visual Studio project with the Spriting example code
Preview 00:02

You need this to load PNG's and JPG's! https://www.libsdl.org/projects/SDL_image/
Installing SDL_Image 2.0
03:38

Sprite class data members overview
05:00

Sprite::Sprite ctor and image load
05:36

Moving the Sprite 1 - Controller class update()
00:45

Moving the Sprite 2 - sprite displacement
03:31

Moving the Sprite 3 - Sprite::update() (bounds)
04:34

Sprite::draw()
02:26
+
Basic game structure using PING: FSM's & Sounds
4 Lectures 16:16

We use the Ping project https://github.com/superwills/Ping to load sfx & music
Sound & Music: Loading
05:30

We use the Ping project (https://github.com/superwills/Ping) to play music & sound
Sound and Music: Playback
05:58

We use the Ping project (https://github.com/superwills/Ping) to learn about FSM's
Preview 04:46
+
Side Scroller game using "Adventures of Dario"
2 Lectures 01:30
CONTENT: Adventures of Dario
00:01

Use of the RectF class for collision detection between adjacent bodies https://github.com/superwills/SideScroller
Collision Detection using Rectangles
01:29
About the Instructor
William Sherif
3.7 Average rating
32 Reviews
1,540 Students
3 Courses
Professional programmer

William Sherif is a competent C++ programmer of 8+ years. He has a wide variety of experiences, from games programming to web programming. He has also been a university course instructor (sessional) for 7 years.

He has published several apps in the iTunes store, including strum and MARSHALL OF THE ELITE SQUADRON.

His interests are varied, but his focus has always been pleasing his clients.

In the past he has been acclaimed for delivering course material in an easy to understand manner.