I'm currently learning SDL for creating graphical applications/games in C++ and have a few questions about how you create and use voids within classes.
For my current project I'm creating a very basic pong game and would like to create a class that not only contains information about an object's position, loaded bitmap and other variables but also a function that covers the AI/Movement Engine and another for the rendering.
I would like to code it so that I could format my code like this: (All code below is pseudo code and only represents the structure of what I want to achieve)
class Object
{
private int stuff;
private void manageStuff();
}
void Object::manageStuff()
{
stuff++;
}
Object object = new Object();
object.stuff = 0;
for (int i = 0; i < 10, i++)
{
object.manageStuff();
cout << object.stuff;
}
Are there any obvious ways of doing this in C++?