Preparing video…

Beginning Game Programming with C#

Start learning how to program video games using the C# programming language. Plenty of practice opportunities are included!

Sessions

Course at a Glance

About the Course

The Beginning Game Programming with C# course is all about learning how to develop video games using the C# programming language. Why use C# instead of C++, Java, ActionScript, or some other programming language you may have heard of? First, using C# lets us use the Microsoft XNA and open-source MonoGame frameworks, which help us quickly develop games for Windows, Android, iOS, Mac OS, and others. Second, the Unity game engine is very popular with indie game developers, and C# is one of the programming languages you can use in the Unity environment. And finally, C# is a really good language for learning how to program.

That learning how to program comment is important because this course doesn't assume you have any previous programming experience. Don't worry if you've never written code before; we'll start at the very beginning and work our way up to building a small, complete game by the end of the course. Throughout the course you'll learn core programming concepts that apply to lots of programming languages, including C#, and you'll also learn how to apply those concepts when you develop games: drawing all the entities in the game world, updating the game world based on user input and simple physics, playing music and sound effects in your games, and so on.

Computer programming is really fun in general, and programming games is even better!

Course Syllabus



Week One: Introduction to the course, the Visual Studio environment, and the Microsoft XNA framework. Writing your first C# program and starting to learn about data types.
Student Work: Programming Assignment 1

Week Two: Classes and objects, the core of object-oriented programming (which works great for games!). Writing your first XNA programs.
Student Work: Programming Assignment 2, Programming Assignment 1 Peer Evaluation

Week Three: Strings and what we can do with them. Selection, how to implement it, and why it's so useful in game development.
Student Work: Programming Assignment 3, Programming Assignment 2 Peer Evaluation

Week Four: No new topics
Student Work: Project Increment 1, Programming Assignment 3 Peer Evaluation

Week Five: Mouse and 360 controller input in XNA. Arrays and collection classes to store multiple pieces of information.
Student Work: Programming Assignment 4, Project Increment 1 Peer Evaluation

Week Six: No new topics
Student Work: Project Increment 2, Programming Assignment 4 Peer Evaluation

Week Seven: Iteration - the various ways we can do multiple things in our code.
Student Work: Programming Assignment 5, Project Increment 2 Peer Evaluation

Week Eight: No new topics
Student Work: Project Increment 3, Programming Assignment 5 Peer Evaluation

Week Nine: Class design and implementation in more detail. How are all those useful classes we've been using actually coded?
Student Work: Programming Assignment 6, Project Increment 3 Peer Evaluation

Week Ten: No new topics
Student Work: Project Increment 4, Programming Assignment 6 Peer Evaluation

Week Eleven: Adding music and sound effects to your games. Keyboard input and text output in XNA.
Student Work: Project Increment 5, Project Increment 4 Peer Evaluation

Week Twelve: The optional project as a great way to review for the Final Exam.
Student Work: Final Exam, Project Increment 5 Peer Evaluation

Recommended Background

No previous programming experience required; all are welcome!

Suggested Readings

I strongly recommend (but don't require) that you purchase Beginning C# Programming with XNA Game Studio by A.T. Chamillard (that's me). It's available as an ebook from Kobo, Barnes and Noble, and Amazon (free eReaders are readily available for the PC and Mac).

The book covers the course material in much more depth than the lectures can and it can serve as a very useful reference as you complete the programming assignments and the project. You can, however, make it through the course without the book by spending more time referencing free online resources, so it's up to you to make a cost/time tradeoff decision based on your personal situation.

Course Format

The class will consist of lecture videos that will generally be less than 15 minutes long. Most lecture videos will contain numerous integrated quiz questions. The required assignments include 6 programming assignments and a small game project you'll develop in 5 increments. There's also a final exam for the course.

Optional activities include numerous small programming labs throughout the course and another small game project in the final week of the course to solidify the course concepts and help you prepare for the final exam. In addition, there's also an optional game you can play on your computer to help motivate you to do the course work.

FAQ

Will I get a Statement of Accomplishment after completing this class?
Students earning a 70% or above will receive a Statement of Accomplishment signed by the instructor.

What resources will I need for this class?
For this course, you'll need to install the free Microsoft Visual C# 2010 Express environment and the free Microsoft XNA Game Studio 4.0 Refresh framework. Although the ebook is strongly recommended, you can complete the course without it by spending extra time using online resources. And, of course, you'll need time, motivation, and brain power!

Can I use a Mac or Linux for the class?
The default development environment for the programming in the course -- Visual C# 2010 Express and XNA Game Studio 4.0 Refresh -- is definitely for Windows, so if you can boot into Windows you should use the default environment. If not, though, Mac and Linux users can use MonoDevelop and MonoGame to do all the course work. I provide all the course materials for Windows users, Mac users, and Linux users.

What if I Can't Install XNA with Windows 8?
Some people have run into compatibility issues when trying to install XNA on a Windows 8 machine. If you  run into that problem, check out the steps here. One of my Coursera students also discovered this link -- http://www.xbox.com/en-US/LIVE/PC/DownloadClient -- which I haven't tried, but it is another option.

What's the coolest thing I'll learn if I take this class?
Contrary to pop culture stereotypes, programming is pretty cool on its own. Even better, though, you'll be learning to program games!