Count the clicks on the tapButton button in the taps variable. Show the count in the countLabel label. From the 10th click on, the label shows "You win!" instead.
After 3 clicks, the label shows Taps: 3. After 10, it shows You win!.
9 strips: D1 to D9
setText("countLabel", "Taps: " + taps); D1taps = taps + 1; D2}); D3} D4onEvent("tapButton", "click", function() { D5if (taps >= 10) { D6setText("countLabel", "Taps: " + "taps"); D7setText("countLabel", "You win!"); D8var taps = 0; D9Order: D9, D5, D2, D1, D6, D8, D4, D3. Extra: D7
var taps = 0;
onEvent("tapButton", "click", function() {
taps = taps + 1;
setText("countLabel", "Taps: " + taps);
if (taps >= 10) {
setText("countLabel", "You win!");
}
}); Extra strip: setText("countLabel", "Taps: " + "taps");. In quotes, "taps" is just the word taps, not the taps variable. The label always shows Taps: taps.