Write the startButton button's onEvent first, then the homeButton button's. A click on the startButton button goes to the gameScreen screen and shows "Score: 0" in the scoreLabel label. A click on the homeButton button goes back to the welcomeScreen screen.
After a click on the startButton button, the gameScreen screen shows.
8 strips: A1 to A8
setScreen("welcomeScreen"); A1setText("scoreLabel", "Score: 0"); A2setScreen(gameScreen); A3onEvent("homeButton", "click", function() { A4setScreen("gameScreen"); A5}); A6onEvent("startButton", "click", function() { A7}); A8Order: A7, A5, A2, A6, A4, A1, A8. Extra: A3
Lines with the same mark can go in either order.
onEvent("startButton", "click", function() {
setScreen("gameScreen");
setText("scoreLabel", "Score: 0");
});
onEvent("homeButton", "click", function() {
setScreen("welcomeScreen");
}); Extra strip: setScreen(gameScreen);. Without quotes, gameScreen is a variable name, and there is no such variable. A screen's id goes in quotes: "gameScreen".