Continuing from the Q&A on the actual video

Capture

In researching further I came across this: (https://www.tutorialspoint.com/cplusplus/cpp_classes_objects.htm)

This goes on to explain that classes are more like blueprints that you fill with with information, like a toy without batteries and depending on what information you add you get different results.

This seems to make a bit more sense to me, however I am still missing some concept somewhere.

I think, if you haven’t already moved from this point, I understand what you’re saying. I think the point of building a class is you provide the game itself with the functions it needs to run, and nothing more.

Struggling to explain, but a couple of examples I can think of that loosely fit are:

a) An API to Google. You can tap google for coordinates, but you can’t do anything else. The API only gives set commands you can interact with.

b) You can’t directly interact with your equipment at an assembly-level. You have the Windows OS and all that other stuff in the way.

In summary, I think you build a class to call on specific methods(functions) built into your application. The class therefore prevents the user or the game from actually calling on the main code.

There’s also the fact you can use similar named functions in separate classes. For example, you could have class FBuildCar and class FBuildTruck. Both of these classes could have the method void GoForward or void Break, but they may differ slightly inside the functions themselves.

Due to inactivity this topic will close in 7 days.
Please either contact a moderator for this to be unlocked or start a new thread.

Thank-you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

Privacy & Terms