Advertisement

Making it OO - SDL

Started by November 23, 2011 10:31 AM
0 comments, last by japro 13 years, 3 months ago
So I have written pong, the almighty pong!
Wrote it in just main, and now I want to do it to OOP.

I just want some ideas how to start.
The game itself is easy, two paddles, one ball. If you score you press spacebar to continue playing and the score is updated. Tada.

Read some other clones on pong and everyone uses different styles. But the main idea is to have a class for input, initialization, game loop, texture..?

I know this is a fuzzy question but I just want to have some idea on how to start.
The most obvious starting point is to make objects out of things that are... well, objects :D. So the paddles and the balls are obvious starting points. Also things like a texture is an object from the programmers perspective.
On the other hand initialization is not an object, it is something you do, so it should probably be a method of a fitting object/class. Make sure to understand Object Orientation at least at the base level. OO is not "let's put everything into classes" (that would be java :P). It's a design concept.

This topic is closed to new replies.

Advertisement