var total = 0;
var i = 1;
function myFunction() {
onEvent("button1", "click", function( ) {
setScreen("screen2");
});
onEvent("button2", "click", function( ) {
setScreen("screen4");
});
onEvent("button3", "click", function( ) {
setScreen("screen7");
});
onEvent("button4", "click", function( ) {
setScreen("screen7");
});
onEvent("button5", "click", function( ) {
setScreen("screen7");
});
onEvent("button6", "click", function( ) {
setScreen("screen7");
});
onEvent("button7", "click", function( ) {
setScreen("screen7");
});
onEvent("button9", "click", function( ) {
setScreen("screen7");
});
onEvent("button8", "click", function( ) {
setScreen("screen5");
});
onEvent("button10", "click", function( ) {
setScreen("screen7");
});
onEvent("button11", "click", function( ) {
setScreen("screen7");
});
onEvent("button12", "click", function( ) {
setScreen("screen6");
});
onEvent("button13", "click", function( ) {
setScreen("screen7");
});
}
function games() {
onEvent("button1", "click", function( ) {
setScreen("screen2");
});
onEvent("button2", "click", function( ) {
setScreen("screen4");
total = total + 1;
});
onEvent("button3", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen2");
myFunction();
total = total - 1;
});
});
onEvent("button4", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen2");
myFunction();
total = total - 1;
});
});
onEvent("button5", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen2");
myFunction();
total = total - 1;
});
});
onEvent("button6", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen4");
myFunction();
total = total - 1;
});
});
onEvent("button7", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen3");
myFunction();
total = total - 1;
});
});
onEvent("button9", "click", function( ) {
onEvent("button15", "click", function( ) {
setScreen("screen3");
myFunction();
total = total - 1;
});
});
onEvent("button8", "click", function( ) {
setScreen("screen5");
total = total + 1;
});
onEvent("button10", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen5");
myFunction();
total = total - 1;
});
});
onEvent("button11", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen5");
myFunction();
total = total - 1;
});
});
onEvent("button12", "click", function( ) {
setScreen("screen6");
total = total + 1;
});
onEvent("button13", "click", function( ) {
setScreen("screen3");
onEvent("button15", "click", function( ) {
setScreen("screen5");
myFunction();
total = total - 1;
});
});
}
games();
onEvent("button2", "click", function( ) {
playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3", false);
});
onEvent("button8", "click", function( ) {
playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3", false);
});
onEvent("button12", "click", function( ) {
playSound("sound://category_achievements/lighthearted_bonus_objective_1.mp3", false);
});
onEvent("button14", "click", function( ) {
write("you got" + total);
});
onEvent("button16", "click", function( ) {
setScreen("screen1");
total = 0;
games();
});