Goal:
Now that we have a random hole chosen, we need to decide which mole to send through the hole
We have a bonus mole that is a lot quicker, but is worth a lot more points if hit. We want this mole to appear, but not all the time
To do this we pick a number between 1 and 10, and we only spawn this bonus mole if the number 5 is chosen.
This means that we have a 10% chance for the bonus mole to appear!
Steps:
- From Variables place a set to block underneath the block of code from the last step
- Inside the set to block on the left side, set the variable to be “moleChooser”
- From Operators, place a pick random block inside the set to block on the right side
- In the pick random block, set the left side to 1 and the right side to 10
- From Control, place an if then…else block
- From Operators, place an “=” block inside the if then block
- From Variables place round “moleChooser” block on the left side of the “=” block
- Type in a 5 on the right side of the “=” block
- From Events place a broadcast block under the if then section of the if then…else block
- On the broadcast block, set the message to be “SendBonusMole”
- From Events place a broadcast block under the else section of the if then….else block
- On the broadcast block, set the message to be “SendNormalMole”