Archived

This topic is now archived and is closed to further replies.

wazoo69

IsoHex engine design problem

Recommended Posts

First of all, KUDOS to TAANSTAFL for his awesome book! Just picked it up this week and it''s helped me a LOT with Iso theory... Right now I''m designing/implementing a 2d game engine that can be used in both OpenGL and Direct3D8. I''ve run into a snag in my design and I''m wondering if anyone has any advice... I had a real semi-epiphany yesterday about what I want to do with my engine, and just need a bit of guidance on implementation. My goal is to have a "I2DGameEngine" class which is an interface for a 2d game (like Gauntlet, CivII, or mario bros.) I also want to have 3 classes (to start with) derived from this interface: -2DIsoGameEngine -2DHexGameEngine -2DPlatformGameEngine Which has accompanying "materials"..ie. the view of the map corresponds to the engine type (ie. a 2DIsoGameEngine view is defaulted to an isometric "civII" view)..etc The mouse cursors will change depending on the engine type, same with the tiles, etc.. Now I guess I''m trying to find a way to grab a pointer to EVERYTHING. What I mean by that is so far I have ONE factory class for each type of object (ie. a TileFactory class to make either Iso, Hex or Platform Tiles), etc. BUT what I WANT to do is that once the programmer instantiates a 2DIsoGameEngine class, then the system automatically knows which accomanying material to generate! ie. with every call to "createTile" the system will automatically create a IsoTile.. Now a design I came up with last night, basically turns the "2DIsoGameEngine" object into a "god" factory class. So when you want to create a new tile you go through this object. Bad idea, I know, but there must be an easier way!!! Suggestions?? (do you guys understand what I''m trying to do?? Did I explain it clearly enough??) Basically I''m in effect hoping to create a small 2d "sdk" for game developers...NEATO! Wazoo

Share this post


Link to post
Share on other sites