14

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.

Bloodyaugust
  • 2,463
  • 8
  • 30
  • 46
  • 12
    As 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
  • 15
    I 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
  • 3
    In 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 Answers5

20

Books

Beginning .NET Game Programming

Beginning C# 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

Tutorial Listing at C# corner

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.

Robert Greiner
  • 29,049
  • 9
  • 65
  • 85
6

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!

Community
  • 1
  • 1
Bobby
  • 1,666
  • 3
  • 16
  • 27
1

This link seems reasonable ( if a little verbose ) - it's takes you through how to code a simple tetris-like game in c# using GDI+. I has code listings and links to download the source code.

zebrabox
  • 5,694
  • 1
  • 28
  • 32
0

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.

Danny Varod
  • 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
0

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.

Chris Meek
  • 5,720
  • 9
  • 35
  • 44