C/C++ Learning Graphics for Simple Games in C++: A Beginner's Guide

  • Thread starter Thread starter Thadis
  • Start date Start date
  • Tags Tags
    Graphics
Click For Summary
For someone new to computer programming looking to create a simple side-scrolling game in C++, utilizing existing libraries can significantly ease the process of rendering graphics and handling input. Libraries that support 2D graphics are recommended, as they allow the user to focus on gameplay rather than the complexities of graphics programming. While developing game levels and assets can be time-consuming, hardcoding levels directly into the executable can simplify this aspect. A suggested project idea is a maze game where the player navigates an object through moving obstacles, which avoids the need for complex animations and special effects. This type of game is considered feasible within a few months, even for beginners. Additionally, the user is exploring books to learn C++ basics and is seeking recommendations for resources that cover simple game graphics programming.
Thadis
Messages
43
Reaction score
0
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?
 
Technology news on Phys.org
Thadis said:
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?

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).
 
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
 
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.
 
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
 
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 16 ·
Replies
16
Views
4K
Replies
69
Views
10K
Replies
15
Views
3K
Replies
3
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
Replies
86
Views
2K
  • · Replies 102 ·
4
Replies
102
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
Replies
81
Views
7K