How to Create Procedures and Announcements in MicroWorlds EX (Part 4)

If the turtle (your golf ball) falls into the water trap, you want your game to respond appropriately. You can make this happen by creating an on-color instruction. In MicroWorlds EX, you accomplish this by creating a command, and those are called Procedures. You put together Primitives to make Procedures, and you put together Procedures to make other Procedures.

Create a Water Trap Procedure so that when the turtle touches the blue field in your game, the Water Trap Procedure is executed. You also want to create a Win Procedure for when the turtle touches the black.

For your Water Trap Procedure, you want to hide the turtle so it looks like the ball has sunk. Then consider making an Announcement (some text to appear on screen when the player hits the water trap) so your player knows what happened, and insert a brief pause (as short as a tenth of a second, but as long as you wish) in the game so your player has time to see what’s happening and respond. Next, set the turtle back to the starting position.

For your Win Procedure, again you’ll want to hide the turtle and make a new Announcement, with another pause, and determine what happens next (for example, the game progresses to the next hole, or starts over if this is your only hole).

You can create a flag for your hole to make your game look more fun and realistic, and lastly, think about freezing the golf ball so that no player can just grab it and put it in the hole to cheat.