We will code a
Pickup class that has a
Sprite, member as well as other member data and functions. We will add pickups to our game in just a few steps:
Pickup.hfile. This will reveal all the details of the member data and the prototypes for the functions.
Pickup.cppfile which, of course, will contain the definitions for all the functions of the
Pickupclass. As we step through it, I will explain exactly how an object of type
Pickupwill work and be controlled.
Pickupclass in the
mainfunction to spawn them, update them and draw them.
Let's get started with step 1.
To make the new header file, right-click Header Files in the ...