Learn C++ Game Development

C++ game development course for beginners.
4.1 (275 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,235 students enrolled
$20
Take This Course
  • Lectures 53
  • Contents Video: 6 hours
    Other: 2 mins
  • Skill Level Beginner Level
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 5/2012 English

Course 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.

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

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.

Section 1: Lesson 1: Setup
12:55

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.

07:23

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

09:27

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

Section 2: Lesson 2: The window
11:45

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

08:06

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

07:24

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

1.4 MB

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

Section 3: Lesson 3: Events
09:59

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

11:41

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

1.4 MB

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

11:34

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;
1.4 MB

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

Article
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…
12:58

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

Section 4: Lesson 4: Drawing or rendering
15:32

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

1.4 MB

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

09:31

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/

03:57

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/

1.7 MB

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

07:54

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.

2.2 MB

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

Section 5: Lesson 5: Sounds and music
03:59

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.

07:06

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/

2.9 MB

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

05:10

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/

2.9 MB

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

Section 6: Lesson 6: Game mechanics
09:32

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

2.8 MB

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

12:42

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

2.8 MB

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

08:59

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

2.8 MB

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

Section 7: Lesson 7: Creating the game "Pong"
07:48

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.

3.6 MB

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

07:46

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

3.6 MB

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

15:12

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

3.6 MB

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

10:24

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

3.6 MB

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

12:34

In this video we finish up our game.

7.4 MB

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

Section 8: New content
README first: Updates
Article
18:10

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).

14:22

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.



16:27

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

18:49

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.

17:56

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

16:42

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

09:09

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

03:41

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.

12:01

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

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Luka Horvat, 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.

Ready to start learning?
Take This Course