The goal of the Rendering Engine for HoverEX is to beable to easily integrate the rendering and internal data of the game.
For example, rendering a puck would require the direction and location of the puck. Rendering an item would require the type of the item and it’s position.
HoverEX requires different layers of rendering. Bellow lists the layers in order.
To build the render system, we have the Rendering engine known as HX_Renderer. This rendering system stores the rendering context rectangle, camera offset, zoom size and stuffs that a renderer should know.
The rendering system is designed to manage the layer rendering without actually knowing all the details of each and every item and how they work.
The only special part of the rendering system is the rendering of the tile map which is done directly in the renderer itself.
Aiding the render system, Object Renderer is introduced to ease coding. In code, it’s called the HX_ObjectRenderer.
The Object Renderer’s main purpose is to translate data of the game into renderable items. By default, the HX_ObjectRenderer will read the HX_Object and render accordingly to it’s position, rotation and surface.
Other special objects that doesn’t comform to normal object rendering will simply just inherit from the HX_ObjectRenderer and implements it’s own rendering code; namely HX_TurretRenderer.
Due to the Object Renderer is being managed by HX_Renderer, it is impossible to remove them when it’s nolonger needed directly on some occations. Being so, HX_Renderer is designed to remove any Object Renderer it come accross, that points to an object with the dead flag set. Thus making any Object with the dead flag set removes it’s Object Renderer from the Renderer.