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

  • Thread starter Thadis
  • Start date
  • Tags
    Graphics
In summary, the conversation discusses the possibility of creating a simple game with graphics using C++ for a school project. It is suggested to use existing libraries for graphics and to focus on the gameplay code. One potential project idea is a maze game where the player must avoid moving obstacles. The conversation also mentions the option of learning the basics of C++ through books and seeking help or resources as needed.
  • #1
Thadis
44
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
  • #2
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).
 
  • #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
 
  • #4
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.
 
  • #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
 
  • #6

1. What are the basic principles of graphics programming?

The basic principles of graphics programming include understanding coordinates, colors, and how to draw basic shapes such as lines, circles, and rectangles. It also involves learning about algorithms and data structures for creating and manipulating graphics.

2. What programming languages are commonly used for graphics programming?

The most commonly used programming languages for graphics programming are C++, Java, and Python. These languages have libraries and frameworks specifically designed for creating and manipulating graphics.

3. How do I get started with graphics programming?

To get started with graphics programming, it is recommended to learn a programming language and its graphics library. There are also many online tutorials and resources available for beginners to learn the basics of graphics programming.

4. What are some common challenges in graphics programming?

Some common challenges in graphics programming include understanding complex algorithms and data structures, troubleshooting and debugging errors, and optimizing graphics for different devices and screen sizes.

5. How can I improve my skills in graphics programming?

To improve your skills in graphics programming, it is important to practice regularly and continuously challenge yourself with new projects. It can also be helpful to learn from experienced programmers and participate in online communities and forums to exchange knowledge and techniques.

Similar threads

  • Programming and Computer Science
Replies
15
Views
2K
  • Programming and Computer Science
Replies
9
Views
1K
  • Programming and Computer Science
Replies
16
Views
2K
  • Programming and Computer Science
Replies
8
Views
360
  • Programming and Computer Science
Replies
7
Views
687
  • Programming and Computer Science
Replies
3
Views
3K
  • Programming and Computer Science
2
Replies
69
Views
4K
  • Programming and Computer Science
Replies
4
Views
1K
  • Programming and Computer Science
Replies
5
Views
948
  • Programming and Computer Science
Replies
1
Views
770
Back
Top