We can use lists, and loops with if-statements, events and randomness to make some interesting games. This section provides you with an idea on how to incorporate a lot of what you have learned so far to make a fun game!
We are going to make a game like BopIt. To make this game, start with the world BopIt.a2w at the bottom of this page.
Save your world as Ch11-EA-BopIt-YourName(s).a2w
You have a list called interactive pieces which consists of this:
You need two events:
Your method Check Click should see if the object that was clicked on is one of the objects in the list and is the one that is fully visible:
Your my first method should consist of:
Loop Infinity
Choose a random item from the list and set it to completely visible
Wait 1 second
Check if the item that you made visible was clicked on, if not then warn the player that they missed one and need to get ready for the next one
[Q11.4.1]: Can you figure out how to check?
(Consider putting a hint here - see teachers edition - dp May 2017)
[Q11.4.2]: In the code below, will all the ballerinas spin?