Learn C++ Game Development
4.5 (296 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.
8,476 students enrolled
Wishlisted Wishlist

Please confirm that you want to add Learn C++ Game Development to your Wishlist.

Add to Wishlist

Learn C++ Game Development

C++ game development course for beginners.
4.5 (296 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.
8,476 students enrolled
Created by Luka Horvat
Last updated 10/2016
English
Learn Fest Sale
Current price: $10 Original price: $20 Discount: 50% off
1 day left at this price!
30-Day Money-Back Guarantee
Includes:
  • 6 hours on-demand video
  • 3 Articles
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Description

Learn C++ game development is a course I made for everyone who knows how to program, but doesn't know where to start with game development. The course teaches you how to use the SFML library for C++, to start working with graphics, events and sound to create a 2D game. Everything is done step by step with the help of videos, so it's easy to follow along and learn. At the end of the course you will know what you need for game programming and will be able to start making your own games.

Warning: This course was published more than 2 years ago and the technology used in it progresses fast. The current most updated version of SFML (2.1) doesn't work out of the box with Visual Studio 2013 (or the express editions) and it requires more work to setup. If you want to follow this course easily, then you should use the 2012 or older version of Visual Studio (or the express edition) which can still be officially downloaded from Microsoft site.

Students Who Viewed This Course Also Viewed
Curriculum For This Course
Expand All 54 Lectures Collapse All 54 Lectures 06:13:18
+
Introduction
1 Lecture 02:34

A welcome video where I explain what you need for the course, what you will learn and how it's going to progress.

Preview 02:34
+
README: Basic information
1 Lecture 00:28
New course content
00:28
+
Lesson 1: Setup
3 Lectures 29:45

A new video, where I will show you how to prepare you environment, so you can continue with the course using the latest Visual Studio 2013 and SFML 2.1. You can skip lecture "Installing Visual C++" and "Installing SFML" if you use this video.

Made because there were many questions on how to use the latest software with this course.

The microphone quality is a little bad and some words are muffled, but I hope this video will help everyone out there.

Preview 12:55

In this video I show how to install Visual C++ Express 2010.

Link to the site:

http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-cpp-express

Installing Visual C++
07:23

In this video I show how to prepare te library SFML to use it with Visual C++.


Link for the download:

http://www.sfml-dev.org/download/2.0-rc/SFML-2.0-rc-windows-32-vc2010.zip

Installing SFML
09:27
+
Lesson 2: The window
4 Lectures 27:15

In this video I show you how to create the project in Visual C++.

Creating The Project
11:45

In this video I show you how to create a simple window for the game.

Creating the window
08:06

in this video I show you how the basic game loop is constructed.

Game loop
07:24

If you want you can download the file, extract it and then open the solution with Visual C++ Express.

Project zip file
1.4 MB
+
Lesson 3: Events
7 Lectures 46:54

In this video I show and explain to you how to use keyboard events in SFML.

Keyboard Events
09:59

In this video I show and explain to you how we can use a state based system to separate events from logic.

States for events
11:41

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for keyboard events and states
1.4 MB

In this video I show and explain to you how we can use mouse events for our game.


NOTE:

There is a faulty line of code:

int mouseX, mouseY;

Replace it with:

int mouseX = 0, mouseY = 0;
Mouse Events
11:34

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for mouse events
1.4 MB

Here are some exercises for "Lesson 3: Events". These exercises will test if you understood how to use events and separate events from logic. The exercises go from the easiest to the hardest, but are all solvable with some logical thinking. After you finished the exercises or if you don't know one y…
Exercises
00:42

In this video I show you the solutions for the exercises.

Solutions for exercises
12:58
+
Lesson 4: Drawing or rendering
7 Lectures 36:54

In this video I show and explain to you how to draw simple shapes like a rectangle and a circle.

Basic Shapes
15:32

If you wish you can download, extract and open the file to see how the project should look like by now.

project zip file for simple shapes
1.4 MB

In this video I show and explain to you how to create a simple image, load it and render it in the game.

Link to GIMP website:

http://www.gimp.org/

Creating an image and rendering it
09:31

In this video I show and explain to you how to find an image and then prepare it for use in the game.

Link to OpenClipArt website:

http://openclipart.org/

Downloading an image and preparing it
03:57

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for creating and loading images
1.7 MB

In this video I show and explain to you how to load and render fonts in the game.

I have gotten a notice so I will post this here. If you are planning on releasing your games in the future, then don't use Microsoft fonts, but find some free and open sourced ones on the web. They are really easy to find, and you can avoid licensing problems.

Fonts and texts
07:54

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for fonts
2.2 MB
+
Lesson 5: Sounds and music
5 Lectures 16:15

In this video I show and explain to you how to prepare the project in order to be able to use sounds and music in the game.

Preparing the project
03:59

In this video I show and explain to you how to create a simple sound using a website and then load and play it in the game.

Link to site:

http://www.bfxr.net/

Create and play sounds
07:06

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for preparing the project and playing sounds
2.9 MB

In this video I show and explain to you how to find and prepare music to load and play it in the game.

Websites:

http://www.jamendo.com/en

http://media.io/

Playing music
05:10

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for playing music
2.9 MB
+
Lesson 6: Game mechanics
6 Lectures 31:13

In this video I show and explain to you how to use what we have learned till now to create some simple game logic.

Simple Logic
09:32

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for simple logic
2.8 MB

In this video I show and explain to you how to create simple movement with events and rendering.

Simple Movement
12:42

If you wish you can download, extract and open the file to see how the project should look like by now.

Project zip file for simple movement
2.8 MB

In this video I show and explain to you how basic collision works.

Simple collision
08:59

If you wish you can download, extract and open the file to see how the project should look like by now. 

Project zip file for simple collision
2.8 MB
+
Lesson 7: Creating the game "Pong"
10 Lectures 53:44

In this lesson we take a look at the resources we are going to use in the game. We also prepare our code and load eveything.

Part 1 - Resources
07:48

Download the zip and extract it. In it you will find the data folder with the files and the project.

Pong resources and project zip file for part 1
3.6 MB

In this video we get the images on the screen using shapes.

Part 2 - Shapes
07:46

If you wish you can download, extract and open the file to see how the project should look like by now. 

Pong project zip file for part 2
3.6 MB

In this video we add movement to the pad and the ball.

Part 3 - Movement
15:12

If you wish you can download, extract and open the file to see how the project should look like by now. 

Project zip file for part 3
3.6 MB

In this video we create a very simple AI for the 2nd pad, and we add collision check for the ball.

Part 4 - AI And Collision
10:24

If you wish you can download, extract and open the file to see how the project should look like by now. 

Project zip file for part 4
3.6 MB

In this video we finish up our game.

Part 5 - Finish
12:34

If you wish you can download, extract and open the file to see how the project should look like by now. 

Project zip file for part 5
7.4 MB
+
New content
10 Lectures 02:07:45
README first: Updates
00:28

In this video we prepare our development environment on Windows. We install the latest Visual Studio Community Edition that is compatible with SFML, and then install and configure SFML itself with the project. There are some faster ways to get SFML working in a project, but this is more or less the standard way to add libraries.

You don't have to understand the code we write. I'm going to explain it in the next video.

UPDATE: A new version of SFML was released since the release of this video, but that doesn't affect the video. Download the latest version and make sure to use the correct Visual Studio version as specified in the download section (Stated in parentheses).

Preparing out environment on Windows
18:10

In this video we prepare our development environment on Linux. I expect you to have some proficiency with your distribution and package manager. We install the SFML library, cmake and graphics development libraries. Then we install Qt Creator and setup our project.

NOTE: If you are using an older version of Ubuntu, you may have to install:
sudo apt-get install build-essential 

You don't have to understand the code we write. I'm going to explain it in the next video.



Preparing out environment on Linux (Ubuntu)
14:22

In this video we explain the basics of using SFML and create the main game loop.

Main game loop
16:27

In this video we take a look on how to handle keyboard and mouse events. We also see how it's possible to check the state of the keyboard and mouse in our main game logic.

Handling keyboard and mouse events
18:49

In this video we start drawing basic shapes on the screen and check what shape functionality SFML provides.

Drawing basic shapes
17:56

In this video we start to load images as textures and then apply them to our shapes.

Drawing sprites
16:42

In this video we take a look at text rendering. First we acquire a font file, load it, and then use it for rendering.

Using fonts to draw text
09:09

In the first video we forgot to add audio support for out project. We take a look at the required changes in this video.

Linux: QtCreator users only have to add "audio" to the list of components in the CMakeLists file in the find_library line.

Project setup for audio
03:41

We load and play a sound effect and a short music sample.

Playing sound effects and music
12:01
About the Instructor
Luka Horvat
4.5 Average rating
296 Reviews
8,476 Students
1 Course
Independent Game programmer, designer

Luka is an independent game programmer and designer with much experience from different projects and many different programming languages. He has been interested in computer science and programming from his early years. That, and a passion for games lead him into the field of video game design and programming. In 2011 he started making tutorials on game development, and has now moved to Udemy to continue teaching others how to make games.