Getting Closer

Chimera screenshot 2012 10 21

I’ve got an EntityFactory class done so that now you can create any object, be it block, static entity (like the spanner, bread etc.) or animated entity (be it the player, electric fence and so on) using a string. It means I can do this:

    player = (Player *)EntityFactory::getInstance()->buildEntity(“Player”);

To create the Player object, or:

    fence = EntityFactory::getInstance()->buildEntity(“Toaster”);

…to create the animated toaster. 
(The cast is needed for ‘player’ because the return type from buildEntity is of course a pointer to an Entity object, from which Player is derived.)

Now while I realise this is absolutely overkill to re-create the original game (which is what I’m doing), this means I’m well set up for the reboot, for which this will become more important.

I’m pretty close to having the next playable.

Leave a Reply

Your email address will not be published. Required fields are marked *