C++ classes

Classes are collections of variables and functions packaged together that often represent repeated objects in your game.

When you create a class, it's like writing a blueprint or template. Then you can use that template to create a bunch of copies of objects in your game.

Writing classes can help you type a lot less and keep your code much more organized, especially when you have lots of copies of a particular object.

Here's an example of a class that creates goombas. We instantiate two goombas and run a few of the class functions on them: