Step 1: Game Setup

Goal:


The first thing we will need to do is set up the values of some variables when the game starts

A variable is something that can store a piece of information that can be used many times in our code.

Steps:

  1. Select the backdrop/stage (it is located next to the sprites under the main game window)
  2. From Events place a when green Flag Clicked
  3. From Events place a broadcast block
  4. On the broadcast block, set the message to be “MoleDisappeared!” We do this to make the moles disappear if there are any around before the game starts
  5. From Variables place a set to block
  6. In that set to block, on the left side set its variable to Score: and on the right side type in the number 0
  7. From Variables place another set to block under the previous one
  8. In that set to block, on the left side set its variable to “Time Remaining:” on the right side type in the number 30

Code: