I want to learn about programming 2D games in C#. What are the best tutorials that are beginner oriented, written for C#, and preferably use GDI+ (or something equally simple)? I am relying on the experience this community has to direct me towards the best.
-
12As I stated in my question, Google is fine, but I would like to know which tutorials are the best. There are thousands of these tutorials, and I am new to programming, so I would prefer to utilize the experience this site contains. And clarifying the kind of answer I am looking for is far from demanding. Those questions would be asked, so why not just answer them now? – Bloodyaugust Feb 24 '10 at 23:23
-
15I fully agree with bloodyaugust, I see no problem with asking this here, especially because it then becomes a Google-able page which has a voted overview of the best articles. – Epaga Feb 25 '10 at 07:13
-
3In XNA its actually quite easy to to 2D stuff, they have a few built in classes that will help and then there are quite a few projects out there that build on XNA to give an even more comprehensive range of 2D classes. – Grant Peters Mar 04 '10 at 09:45
5 Answers
Books
Beginning .NET Game Programming
Links
Coding 4 Fun is a great .NET resource that has quite a few user-created games. They also have a book and a 2-D game primer
C# Game Tutorial for Beginners (video)
Link to more game programming e-books
Advanced Topics
The Farseer Physics Engine on Codeplex would be a good next step once you get comfortable with programming games. You could even end up contributing to the project if you like it enough. I'm sure they'd appreciate the help.

- 29,049
- 9
- 65
- 85
-
Mostly good tutorials, but the cplus.about one doesn't work because no links to it are provided. Have you actually read any of these? – Bloodyaugust Feb 26 '10 at 19:36
-
that link has a link to free programming e-books, some of which cover game programming. – Robert Greiner Feb 28 '10 at 18:18
I watched these DNR TV episodes recently and thought they were very well done and informative.
http://www.dnrtv.com/default.aspx?showNum=165
http://www.dnrtv.com/default.aspx?showNum=166
These focus on XNA, which is definitely where I'd start if I was planning on creating a game. Their tutorial take you through:
creating a 2D game with:
- collision detection
- texture creation and usage
- geometry creation
- physics simulation (They use an open-source physics engine and show you how to use it)
If you haven't heard of XNA:
The framework runs on a version of the Common Language Runtime that is optimized for gaming to provide a managed execution environment. The runtime is available for Windows XP, Windows Vista, Windows 7, and Xbox 360 [also can be played on Zune HDs].
XNA attempts to free game developers from writing "repetitive boilerplate code" and to bring different aspects of game production into a single system. wikipedia
Even if you don't want to use XNA, I think these videos will help learn about the concepts and techniques common to most (if not all) game dev. Oh, and it's all C# :)
Good luck!
I would start with learn a little object oriented architecture - this is a key to your ultimate success.
Then learn how to design the model - the entities in the game (characters and etc) in code and the view - the 2D representation of them, and how to connect the two (data and command binding).
I would try using WPF and not GDI+.
The code project has a lot of good articles for beginners.

- 17,324
- 5
- 69
- 111
-
WPF is a good starting point for desktop apps, but for graphically intensive 2D stuff, I would recommend GDI+ -- actually calling the various drawing commands and transformation matrices on a Graphics object in a paint loop will very closely mirror the type of experience you get from a real game loop -- plus making things seem full screen is pretty easy. – BrainSlugs83 Aug 12 '13 at 21:44
I would take a look at SDL.Net it's a pretty good games library for .NET (well a binding to a good library for the pedants ;))
It has a lot of resources on its pages right from beginner stuff to more advanced things like isometric engines etc.
It doesn't seem to have been very active for a while however what is there already is more than enough for even complex 2D games.

- 5,720
- 9
- 35
- 44