O'Reilly logo

SDL Game Development by Shaun Mitchell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required