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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.