Sunday, 9 July 2017

Level class structure

After couple of days the final form of level class structure is ready. The difference to my initial plan is that there is one more class. They are:

Gen_Level: This is the base class which contains only the map for tiles and handling simple tasks such as low level get/put tiles.

Shape_Level: This class has routines to create different shapes of terrain tiles. Again, this class is kept very low level.

Object_Level: This is the new class that contains game objects and also room objects. The previous Object_Shed class was copy-pasted into this directly. It also was designed to relieve the amount of lines from that massive Level class that I had, but I realized it can be made a part of the class hierarchy.

Sequence_Level: The dungeon generation class with different parts activated depending on level theme.

Level: Gameplay part of the level structure which has routines that game objects use during the gameplay.

After this there are special themes derived from Level that override some creation procedures. This split seems to work quite nicely and it surely has made the management of code easier already. Level class still has quite few creation related routines which are moved either to Object or Sequence level. When this is ready I can continue working on creation routines of some level themes.

No comments:

Post a comment