While playing a game, players expect to have certain pieces of information on their screen, such as their health, or score, or how many lives they have left. These displays can collectively be called the Heads Up Display, or HUD. Our game is no different, and since we're working on GUI elements, we should start building a HUD to report some information to the player.
Creating our HUD is going to require some DirectGUI
objects, and also some simple flat polygons with textures on them, just like the ones we gave to our DirectFrames
and DirectButtons
when we created the menus.
For things such as the shield and speed bars, our best option for controlling the up and down action is texture manipulation. If we used scaling on curved bars, it would distort the shape of the bar, and it would also compress the nice color gradients when the bars get low. Instead, we'll take advantage of something we learned in the last chapter about textures.
When we were talking about texture modes, we mentioned...