Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var count = 0;
- onEvent("upButton", "click", function() {
- count = count + 1;
- setText("countDisplayLabel", count);
- if (count == 20) {
- setScreen("gameOverScreen");
- setText("finalScoreLabel", count);
- }
- });
- onEvent("downButton", "click", function() {
- count = count - 1;
- setText("countDisplayLabel", count);
- if (count == -5) {
- setScreen("gameOverScreen");
- setText("finalScoreLabel", count);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement