Setting up the basic game objects

The majority of the work that went into creating Alien Attack was done in the object classes, while almost everything else was already being handled by manager classes in the framework. Here are the most important changes:

GameObject revamped

The GameObject base class has a lot more to it than it previously did.

class GameObject { public: // base class needs virtual destructor virtual ~GameObject() {} // load from file virtual void load(std::unique_ptr<LoaderParams> const &pParams)=0; // draw the object virtual void draw()=0; // do update stuff virtual void update()=0; // remove anything that needs to be deleted virtual void clean()=0; // object has collided, handle accordingly virtual void collision() = 0; // get ...

Get SDL Game Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.