Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var lives = 7;
- var score = 0;
- var x3 = ["68", "150", "230"];
- var x = ["51", "146", "250"];
- var y = ["185", "316"];
- var y2 = ["145", "265", "385",];
- setScreen("homescreen");
- onEvent("Howtoscreen", "click", function() {
- setScreen("How To Play");
- });
- onEvent("Back", "click", function() {
- setScreen("homescreen");
- });
- onEvent("Start", "click", function() {
- setScreen("Level#1");
- hide();
- setText("Lives#1", lives);
- setText("Score#1", score);
- setPosition("Apple#1", x [(randomNumber(0, 2))], 225);
- });
- onEvent("Card#1", "click", function() {
- hideElement("Card#1");
- });
- onEvent("Card#2", "click", function() {
- hideElement("Card#2");
- });
- onEvent("Card#3", "click", function() {
- hideElement("Card#3");
- });
- onEvent("Card#4", "click", function() {
- hideElement("Card#4");
- });
- onEvent("Card#5", "click", function() {
- hideElement("Card#5");
- });
- onEvent("Card#6", "click", function() {
- hideElement("Card#6");
- });
- onEvent("Card#7", "click", function() {
- hideElement("Card#7");
- });
- onEvent("Card#8", "click", function() {
- hideElement("Card#8");
- });
- onEvent("Card#9", "click", function() {
- hideElement("Card#9");
- });
- onEvent("Card#10", "click", function() {
- hideElement("Card#10");
- });
- onEvent("Card#11", "click", function() {
- hideElement("Card#11");
- });
- onEvent("Card#12", "click", function() {
- hideElement("Card#12");
- });
- onEvent("Card#13", "click", function() {
- hideElement("Card#13");
- });
- onEvent("Card#14", "click", function() {
- hideElement("Card#14");
- });
- onEvent("Card#15", "click", function() {
- hideElement("Card#15");
- });
- onEvent("Card#16", "click", function() {
- hideElement("Card#16");
- });
- onEvent("Card#17", "click", function() {
- hideElement("Card#17");
- });
- onEvent("Card#18", "click", function() {
- hideElement("Card#18");
- });
- onEvent("Level#1", "click", function() {
- lives = lives-1;
- setText("Lives#1", lives);
- if (lives===0) {
- setScreen("LoseScreen");
- }
- setText("Lives#2", lives);
- });
- onEvent("Apple#1", "click", function() {
- score = score+2;
- lives = lives+2;
- setScreen("Level#2");
- setText("Score#2", score);
- setPosition("Apple#2", x [(randomNumber(0, 2))], y [(randomNumber(0,1))]);
- if (score==6) {
- setScreen("VictoryScreen");
- }
- });
- onEvent("Level#2", "click", function() {
- lives = lives-1;
- setText("Lives#2", lives);
- if (lives===0) {
- setScreen("LoseScreen");
- }
- });
- onEvent("Apple#2", "click", function() {
- score = score+2;
- lives = lives+1;
- setScreen("Level#3");
- setText("Score#3", score);
- setText("Lives#3", lives);
- setPosition("Apple#3", x3 [(randomNumber(0, 2))], y2 [(randomNumber(0,2))]);
- if (score==6) {
- setScreen("VictoryScreen");
- }
- });
- onEvent("Level#3", "click", function() {
- setText("Lives#3", lives);
- lives = lives-1;
- if (lives===-1) {
- setScreen("LoseScreen");
- }
- });
- onEvent("Apple#3", "click", function() {
- score = score+2;
- lives = lives+1;
- setText("Score#3", score);
- setText("Lives#3", lives);
- if (score==6) {
- setScreen("VictoryScreen");
- }
- });
- function Restart1() {
- setText("Lives#1", lives=7);
- setText("Score#1", score=0);
- showElement("Card#1");
- showElement("Card#2");
- showElement("Card#3");
- showElement("Card#4");
- showElement("Card#5");
- showElement("Card#6");
- showElement("Card#7");
- showElement("Card#8");
- showElement("Card#9");
- showElement("Card#10");
- showElement("Card#11");
- showElement("Card#12");
- showElement("Card#13");
- showElement("Card#14");
- showElement("Card#15");
- showElement("Card#16");
- showElement("Card#17");
- showElement("Card#18");
- setPosition("Apple#1", x [(randomNumber(0, 2))], 225);
- }
- onEvent("Settings", "click", function() {
- setScreen("SettingsScreen");
- lives = lives+1;
- });
- onEvent("ReturnButton", "click", function() {
- setScreen("Level#1");
- });
- onEvent("StartOverButton", "click", function() {
- Restart1();
- setScreen("Level#1");
- });
- onEvent("HomeSButton", "click", function() {
- Restart1();
- setScreen("homescreen");
- });
- onEvent("Settings#2", "click", function() {
- setScreen("SettingsScreen#2");
- lives = lives+1;
- });
- onEvent("ReturnButton#2", "click", function() {
- setScreen("Level#2");
- setText("Lives#2", lives);
- });
- onEvent("StartOverButton#2", "click", function() {
- Restart1();
- setScreen("Level#1");
- });
- onEvent("rulesbutton", "click", function() {
- setScreen("How To Play");
- onEvent("Back", "click", function() {
- setScreen("Level#1");
- });
- });
- onEvent("HomeSButton#2", "click", function() {
- setScreen("homescreen");
- Restart1();
- });
- onEvent("rulesbutton#2", "click", function() {
- setScreen("How To Play");
- onEvent("Back", "click", function() {
- setScreen("Level#2");
- });
- });
- onEvent("PlayAgainButtonL", "click", function() {
- setScreen("homescreen");
- Restart1();
- });
- onEvent("Settings#3", "click", function() {
- setScreen("SettingsScreen#3");
- lives = lives+1;
- setText("Lives#3", lives);
- });
- onEvent("ReturnButton#3", "click", function() {
- setScreen("Level#3");
- });
- onEvent("StartOverButton#3", "click", function() {
- Restart1();
- setScreen("Level#1");
- });
- onEvent("HomeSButton#3", "click", function() {
- setScreen("homescreen");
- Restart1();
- });
- onEvent("PlayAgainButtonV", "click", function() {
- setScreen("homescreen");
- Restart1();
- });
- onEvent("rulesbutton#3", "click", function() {
- setScreen("How To Play");
- onEvent("Back", "click", function() {
- setScreen("Level#3");
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement