Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Creative Greenfoot: RAW
  • Table Of Contents Toc
  • Feedback & Rating feedback
Creative Greenfoot: RAW

Creative Greenfoot: RAW

By : Haungs
4.7 (3)
close
close
Creative Greenfoot: RAW

Creative Greenfoot: RAW

4.7 (3)
By: Haungs

Overview of this book

This book is for coding students and Java programmers of all levels interested in building engaging, interactive applications with Greenfoot. Familiarity with the very basics of Greenfoot is assumed.
Table of Contents (12 chapters)
close
close
11
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...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Creative Greenfoot: RAW
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon