-
Notifications
You must be signed in to change notification settings - Fork 0
Start
To make a plugin for EMA, you must first understand EMA's various parts. EMA plugins are broken down into three major parts, only two of which are strictly required, and chances are that you're only coding one. The three parts are The Graphics, The Entities, and The Environment.
The environment is where all the entities live - it's the map. The map is made of hexagon tiles, and every Hex Tile has its own set of properties. All entity plugins require there to be an environment in mind when creating them, since the map is where they get all of their data. The environment for a game such as Frogger could be as simple as a boolean: "Is this tile a road tile?" Entities for such a game would then be cars, trucks, and of course the frog. A template for the environment is provided in Plugins/Environment/Hex.(cpp/h). Read more about coding for the environment here.
Entity plugins can now be made with your environment in mind, and grab any data that they desire from it. Entity plugins must have the file structure described here. An entity must have an void update(int)
function.. This function will be called once per pulse. A derived entity must call the constructor for the Entity class, which only requires its x/y location.
This comes in two parts, one for each Entity Plugin, another for the general game.
-
Every entity plugin can specify how each of its entities ought to be drawn, as described in the plugins' layout guide. The environment will also eventually have a way to specify how it wants to be drawn as well.
-
The overall graphics plugin provides the interface for the application as a whole - it manages all input and has complete control with how one interfaces with the application. The provided graphics plugin also lays out how one might want to deal with various menu screens. Read move here.