Well I found a little bit of time again to work on something for the MC Engine. In this case I have been working on a HUD. At the moment it is only the buttons section, because it directly applies to the actions Link can do.
Okay, now about what I did. I made a new object called objController, my idea was that it can deal with things in the game that does not directly apply to entities in the world, like the HUD, menu, titlescreen and all that.
The HUD itself is only something that needs to be drawn on screen. Thus I put it in a script. At the moment it first draws the buttons and then the actions assigned to the buttons. With the actions two options popped in my mind:
1) Make a giant switch/if statement to see what icon needs to be drawn.
2) Call the scripts assigned to the buttons and let them paint the Icon needed.
The choice was simple, because the second option is a lot faster and far more modular when adding new actions to the engine. A new event was added to the constants denoted as 'HUD'.
At the same time I finished some last details on the Bow. In the last versions the Bow did nothing with the amount of arrows. Now I made two global variables:
1) cur_arrows = the number of arrows Link is currently holding.
2) max_arrows = the maximum number of arrows Link can hold.
The current number of arrows is given with the Bow Icon.
The Controller object is currently rather empty and small, but in time it can grow larger. But I did add something extra, which should not considered to be a part of the engine. Instead of stopping the engine to change actions assigned to the buttons or reset the arrow count, you can now do this by pressing 'PgUp' and 'PgDn'. On there own those buttons don't do much, but in combination with another you can change things.
'P' => changes the action assigned to the A button.
'O' => changes the action assigned to the B button.
'I' => increases and decreases the amount of cur_arrows.
I'd love to have some input, about how you guys would do this.
Enjoy!