Write the score variable first, then the updateScreen() function, then the hitButton button's onEvent, then the missButton button's. A hit adds 10 to score, and a miss subtracts 5 from score. Both call updateScreen() to show the score in the scoreLabel label.
After a hit and then a miss, the label shows Score: 5.
13 strips: F1 to F13
function updateScreen() { F1updateScreen; F2var score = 0; F3updateScreen(); F4score = score - 5; F5onEvent("missButton", "click", function() { F6} F7setText("scoreLabel", "Score: " + score); F8}); F9}); F10onEvent("hitButton", "click", function() { F11updateScreen(); F12score = score + 10; F13Order: F3, F1, F8, F7, F11, F13, F4, F9, F6, F5, F12, F10. Extra: F2
var score = 0;
function updateScreen() {
setText("scoreLabel", "Score: " + score);
}
onEvent("hitButton", "click", function() {
score = score + 10;
updateScreen();
});
onEvent("missButton", "click", function() {
score = score - 5;
updateScreen();
}); Extra strip: updateScreen;. Without (), updateScreen names the function but does not call it, so a click on that button never changes the label.