SunFounder ESP32 Starter Kit
Next, in the [forever] block, four [if] blocks are used to determine various possible scenarios.
• If the button is 1 (pressed), use the [mod] block to toggle the value of the variable flag between 0 and 1 (alternating
between 0 for this press and 1 for the next press).
• If flag=0 (this button press), let the Beetle sprite turn clockwise. Then determine if flag is equal to 1 (button
pressed again), the Beetle sprite moves forward. Otherwise, it keeps turning clockwise.
4.17. 2.14 GAME - Eat Apple 587