February 27, 2017

Engine Under Construction: TinyAdventurer - Part I

Another Monday Post and now is time for talking about the second framework in the list:  TinyAdventurer.

This class library goes up one more step towards the real game code and is responsible for supplying the base classes to support the main structure of the game. It is the bridge between the low-level library who knows very little about the game (TinyEngine) and the ultimate code that makes up the real creature. Let's see the types I've right now:


The Room class derives from the TinyEngine.Scene class which is defined in the TinyEngine library (remember?). The game will be composed of several rooms, which the player moves between as he/she plays the game. Each room is one screen containing its own background, layers, walking boxes and things. 

Did I say things? What are things? Well, things are...things. I'm a thing? Are you a thing? Are we things? Who is a thing? Sting things? sings? sin? cos?


In a nutshell, a Thing is an animated sprite (TinyEngine.AnimatedSprite) with extended capabilities that will be used by a handsome class library consumer (me) to derive specific types like inventory items, interactive background objects, actors (characters and NPCs), weapons and consumables.

Rooms and Things are both game entities. Both classes implement the IEntity interface.  Entities have three peculiarities:

  1. They have a unique name among the game universe.
  2. They have persistence capabilities.
  3. They have the ability to contain other things through the use of an inventory. Therefore, rooms can contain things which in turn can contain other things, which in turn can contain other things, which in turn can contain other things and so on.

Entities are declared via the scripting language and instantiated during the initialization phase. They can also be dynamically created at run-time. I will talk more about the scripting language I'm currently working on in a few...weeks? However, to calm the anxiety here is a screenshot of the TinyEditor with some room code... (for your eyes only)


Finally, GameSession is a static class responsible for grouping, tracking, saving and loading the huge collection of game entities within the game universe.

Step by step, class to class...

- Diego


No comments:

Post a Comment