Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Graphics for a New Programmer

  1. Dec 4, 2011 #1
    I have a question are there any books that might show someone who is fairly new to computer programming how to add images for a simple game that is not just text based in c++? It mostly just be something fairly simple, like a side scroller(that would probably be as complex as I would want it for right now.). I am doing this for a school project and think this would be a good way to have something to show for me finishing. Are there any books that could teach me this even though I have very little actual programming knowledge as of now? or is this asking to much?
  2. jcsd
  3. Dec 4, 2011 #2


    User Avatar
    Science Advisor

    Hey Thadis.

    Depending on how much experience you have, you might be better off downloading some existing libraries that do all your hard stuff like rendering 2D or 3D images, user interface, and so on, while you write the actual gameplay code yourself.

    If you want to hardcode the gameplay code in your executable, then I think you could do something in a short space of time.

    You will need a graphics library that supports 2D scrolling capabilities. I've only ever done 3D games myself so I can't recommend any libraries out there for 2D-specific routines.

    The input shouldn't be too hard, just use DirectInput and write some routines to handle your input code. Sound can be done by DirectX or using OpenAL. OpenAL is pretty good but I can't comment on the DirectSound part of DirectX.

    The hit-detection and physics is a lot easier than 3D. If you don't have time to anything fancy just use an axis aligned bounding box in 2D (axis aligned means the edges are parallel to the axis).

    The difficult thing will be to develop tools to make levels and game assets. If you hardcode levels as part of data in your executable then fair enough, but if you want to develop tools to make levels, then this will form a major chunk of your time. It doesn't have to be complex, but realize that things always take more time than you anticipate.

    If you have specific questions about an area of game design I'll do my best to answer them (I used to do this kind of thing).
  4. Dec 4, 2011 #3
    Thanks and yeah I might be able to use existing libraries as longs as I give them credit for it. If I do this then it would only probably be a very simple thing just to have something visible for them to see what I did because I do not know any other programs that actually show something besides just small things to someone who doesn't do programming it is not really that significant. If you would have any suggestions for a project idea that I could finish within a few months without much prior knowledge of c++ I am open to suggestions
  5. Dec 5, 2011 #4


    User Avatar
    Science Advisor

    One idea that comes to mind is a maze kind of game where you have to dodge things that move.

    Basically you are an object (like a square for example), and you have to go from one point to the next without colliding with the rest of the world that moves.

    With this kind of game you don't have to worry about special effects like bullets or any kind of complex animation. The levels should be a lot easier to design since you only have to describe the objects and their movement behaviors, and it without all of the bells and whistles that other graphic intensive games have, it would still be a pretty fun and challenging game to play.

    I think this is definitely a doable thing given your time constraints.
  6. Dec 5, 2011 #5
    Yeah that seems like something that I would be able to do and if I could get graphics into the program. I am not able to officially start my project till mid January though I think but I might contact you between then and May if I need help or I might post it on this forum or on of the c++forums
  7. Dec 6, 2011 #6
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook