Thread: A Simple 2D Game- Where do I Start?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    127

    A Simple 2D Game- Where do I Start?

    Guys,

    Basically I've been teaching myself to program C++ for about the last 9 months, making a simple chat bot thing. I've learnt a bit about classes, functions within them etc.

    Something I've always been interested in is making games. However it seems like there are so many different ways of programming graphics these days (OpenGL etc.) that I'm not sure where to start. I don't want to learn something then find out that it's useless for anything else.

    I don't know if you guys remember the game Speedball 2, but I'd like to be able to recreate that, ultimately. It's a top down 2D sports game basically.

    BTW I've been learning to program using Visual Studio Express.

    So how do you guys think I should go about learning how to program a 2D game?

    Thanks.

  2. #2
    Registered User
    Join Date
    Oct 2006
    Location
    UK/Norway
    Posts
    485
    Pong has to be the easiest game to start with.

    By doing several of the tutorials on this page you should know enough to get started
    http://nehe.gamedev.net/

    Good luck

  3. #3
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    A book.

  4. #4
    Registered User guesst's Avatar
    Join Date
    Feb 2008
    Location
    Lehi, UT
    Posts
    179
    I've got a website that could get you started. At the moment I'm only as advanced as Curses (text-based stuff) but will be getting into Allegro and SDL shortly.
    Type-ins are back! Visit Cymon's Games at http://www.cymonsgames.com for a new game every week!

  5. #5
    Registered User
    Join Date
    Mar 2008
    Posts
    11
    IMHO, the allegro library is a great place to start with 2d games. The syntax is simple enough and it's powerful enough to make some decent games. If you're interested, hop on over to http://allegro.cc

  6. #6
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    If you're using OpenGL, I recommend http://www.opengl.org/documentation/red_book/
    the OpenGL programming guide.

  7. #7
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    I like the SDL, for 2D programs. It lets you use OpenGL, too, if you want to later on.
    libsdl.org
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  8. #8
    Registered User
    Join Date
    Jul 2008
    Posts
    6
    Like dwks I prefer SDL, there are a lot of good tutorials a google search will provide you with plenty and its easy to learn and understand, while still being low level.

    I would suggest www.gamedev.net for some tutorials along with the game developer wiki.

  9. #9
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    It really isn't about the library IMO, it's really all the same thing. You'll need maths, and a will to learn

  10. #10
    Registered User Stonehambey's Avatar
    Join Date
    Jan 2008
    Location
    Kent, UK
    Posts
    118
    Although I haven't really used it much, this site looks interesting for getting into OpenGL and GLUT.

    http://www.videotutorialsrock.com/

  11. #11
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    GLUT is old. Go with something with a bit more future like GLFW

  12. #12
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    It really isn't about the library IMO, it's really all the same thing. You'll need maths, and a will to learn
    100% agreed. The OP would do well to heed this advice. Don't worry about the choice of library until you understand the underlying concepts and have a well thought out design prior to starting. You can't design everything on paper but you can have at least a very good framework to guide you.

    Libraries are a dime a dozen. Games take a lot of work, talent, and dedication and this is true for even simple 2D games. I recommend buying books on vector math, matrix math, graphics concepts (either raw D3D or raw OGL), etc. Once you understand how D3D or OGL work then you can choose which engine or library you want to use. But starting with a library or engine with no knowledge of D3D or OGL, graphics concepts, programming fundamentals, etc., will just be an exercise in futility.

    To make a game you must know C++ very well and be extremely comfortable with it. This is the first requirement and superceded any other requirement. After that you must understand the concepts of game programming which are a bit different than your normal application. And before you start coding you will want a basic design laid out so you don't code yourself into a huge corner.
    Last edited by VirtualAce; 07-27-2008 at 07:44 PM.

  13. #13
    Registered User
    Join Date
    Jul 2008
    Posts
    71
    Quote Originally Posted by Bubba View Post
    100% agreed. The OP would do well to heed this advice. Don't worry about the choice of library until you understand the underlying concepts and have a well thought out design prior to starting. You can't design everything on paper but you can have at least a very good framework to guide you.

    Libraries are a dime a dozen. Games take a lot of work, talent, and dedication and this is true for even simple 2D games. I recommend buying books on vector math, matrix math, graphics concepts (either raw D3D or raw OGL), etc. Once you understand how D3D or OGL work then you can choose which engine or library you want to use. But starting with a library or engine with no knowledge of D3D or OGL, graphics concepts, programming fundamentals, etc., will just be an exercise in futility.

    To make a game you must know C++ very well and be extremely comfortable with it. This is the first requirement and superceded any other requirement. After that you must understand the concepts of game programming which are a bit different than your normal application. And before you start coding you will want a basic design laid out so you don't code yourself into a huge corner.
    can you name a few book titles to get started?
    thanks.

  14. #14
    Registered User Stonehambey's Avatar
    Join Date
    Jan 2008
    Location
    Kent, UK
    Posts
    118
    Quote Originally Posted by zacs7 View Post
    GLUT is old. Go with something with a bit more future like GLFW
    So is that why code::blocks throws up over 50 errors in "glut.h" (i.e. the GLUT header file you download) when trying to compile something using it? I thought this was strange since it's a file which comes straight from the download.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating a simple Windows game
    By ejohns85 in forum C Programming
    Replies: 1
    Last Post: 05-22-2009, 12:46 PM
  2. PC Game project requires c++ programmers
    By drallstars in forum Projects and Job Recruitment
    Replies: 2
    Last Post: 02-22-2006, 12:23 AM
  3. Looking for coder: Simple C++ Client / Server game
    By kocho in forum Projects and Job Recruitment
    Replies: 1
    Last Post: 02-04-2006, 02:34 PM
  4. Game programming ........ Where is good place to start?
    By 3DPhreak in forum Game Programming
    Replies: 4
    Last Post: 06-17-2004, 10:54 AM
  5. how to start with game
    By Unregistered in forum Game Programming
    Replies: 4
    Last Post: 09-27-2001, 08:18 AM