Book Image

Creative Greenfoot: RAW

By : Michael Haungs
Book Image

Creative Greenfoot: RAW

By: Michael Haungs

Overview of this book

Table of Contents (17 chapters)
Creative Greenfoot
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a HUD


We are going to add a simple set of actions for the main character in the game. Figure 11 shows the three controls we are adding. If the user clicks on the first icon, then the enemies will be temporarily stunned. If the user clicks on the second icon, then the enemies will move slower for a short period of time. If the user clicks on the last icon, then the snake enemies say, "sssssssss". Having the snakes hiss does not really help the player beat the game. I just thought it was something fun we could add.

Figure 11: This shows a set of controls we are adding to MazeWorld

Figure 12 is a close-up view of the controls when placed in the game; we are adding them to the bottom-middle of the screen.

Figure 12: This shows the HUD in the game

Using your favorite graphics editor, create something similar to the picture shown in Figure 12. I made my graphic fairly small so that it would be fully contained in the bottom black border of the game.

Once you have an appropriate graphic, create...