The card consists of
Coding the Stack Script
To create an app that loads a splash card on open, you must edit the stack script. This will load the splash page on the standalone app. To navigate between stack cards, use the project browser.
Coding "Play"
The play button is a simple button that brings the user to the main card / game. In this case, "level 1"
Coding "Instructions"
The code for "instructions" does a number of things. First it hides the duck image, then makes visible the field displaying the text. The app displays the instructions for 6 seconds then reloads the card to normal.
The card consists of
Coding the Card: openCard
The card is coded to open and display all 6 duck buttons immediately. This automatically resets the card each time the app is open. It can be modified to load an instruction field: (show field "instructions") combined with a wait code (wait 10 seconds).
Coding the Card: countDown
The countDown command is called when the start button is pressed. The conditional loop reads the value of the variable "timer" to see if the value is 0. If the timer has run out, the app displays a message through the "answer" code. Otherwise, the times is reduced by 1 and recalled again. This is what creates a loop structure. To exit the loop, timer has to become 0.
Coding Start Button
The start timer button places a numerical value in the field timer and calls the command countDown to being. This initializes the loop above. Another level could simply reduce the value placed into the timer and increase the difficulty. #level2
Coding Stop Button
The stop button is pressed when all the ducks have been clicked. The code places 0 into the field timer and therefore exits the loop. It also displays a message that you have won the game.
Coding Reload Button
The reload button returns all ducks to a visible state.