Welcome to the DFRobot blog
:
www.dfrobot.com/blog-tag-microbit.html
81
/
86
STEP 4: Put everything we mentioned above inside an “if-then” loop to compare if the two
directions match. Also, don't forget the “forever” loop to keep the game always on going.
Note: it will be helpful to add a “While” function inside the loop, so as to avoid identical directions
appear in a row.
STEP 5: it's the time to add the bomb. The bomb will start ticking as soon as the game begins. Also,
we will use the RGB LED strip to simulate the fuse. With the time running, the LEDs on the fuse will go
off one after another in a steady pace. If micro:bit cannot make it to escape the maze before the
fuse burning out, the game is over.
The flow chart below shows how to set the LED go one by one with the time going.