var page =0; setText("lblStory","You are on a walk and you find a time travel device."); setText ("btnStart","Pick It Up"); onEvent("btnStart", "click", function( ) { setText("lblStory","You are trying to decide what you want to do with this device."); setText("btnA","Travel Into The Future"); setText("btnB","Travel Into The Past"); showElement("btnA"); showElement("btnB"); hideElement("btnStart"); }); onEvent("btnA", "click", function( ) { if (page==0){ //Travel Into Future page=1; setText("lblStory","You travel into the future and are brought into a huge city, with skyscrapers everywhere, flying cars, robots, everything you could think of."); setText("btnA","Talk to the locals"); setText("btnB","Start exploring the city"); } else if (page==2){ //(Past) Go towards cavemen page=6; setText("lblStory","You go towards the group of Cavemen and see them trying to fight off a dinosaur."); setText("btnA","Help Them"); setText("btnB","Watch Them"); }else if (page==1){//(Future) Talk to locals page=3; setText("lblStory","You start talking to the locals and they can tell that you aren't from there. They start questioning where you came from."); setText("btnA","Tell them you are traveling"); setText("btnB","Tell them the truth"); } else if (page==3) { page = 5; setText("lblStory", "They don't believe you, but you keep trying to convince them. A nearby police officer comes to see what all the commotion is about. Things elevate and he starts trying to arrest you."); setText("btnA", "Try To Run"); setText("btnB", "Cooperate"); } else if (page==5) { page = 7; setText("lblStory", "You try to run but they catch you and they bring you to the local jail. You are held for a long time, when 2 men in black suits come inside and start questioning you on where you came from."); setText("btnA", "Tell them about the device"); setText("btnB", "Tell them you're traveling"); } else if (__) { } else { }setText("lblPage","Page Number: "+page) }); onEvent("btnB", "click", function( ) { if (page==0){//Travel Into The Past page=2; setText("lblStory","It brings you to the top of a valley. As you look down the valley, you see a group of cavemen fighting a dinosaur. What do you do?"); setText("btnA","Go help them"); setText("btnB","Go the opposite way"); } else if (page==2){//(Past) Go opposite way page=4; setText("lblStory","You start exploring when you hear a T-Rex roar near you. However, you see a nearby cave."); setText("btnA","Run Away"); setText("btnB","Hide In The Cave"); } else if ((page == 6)) { page = 8; setText("lblStory", "You watch them as they defeat the dinosaur. After killing it, they start looking around and see you. What do you do?"); setText("btnA","Try to talk to them"); setText("btnB","Run Away"); } else if ((page == 3)) { page = 5; setText("lblStory", "They don't believe you, but you keep trying to convince them. A nearby police officer comes to see what all the commotion is about. Things elevate and he starts trying to arrest you."); setText("btnA", "Try To Run"); setText("btnB", "Cooperate"); } else if ((page == 5)) { page = 7; setText("lblStory", "You cooperate and they bring you to the local jail. You are held for a long time, when 2 men in black suits come inside and start questioning you on where you came from."); setText("btnA", "Tell them about the device"); setText("btnB", "Tell them you're traveling"); } else if (page == 7) { page = 9; setText("lblStory", "They start questioning you on where you're traveling from, and they don't believe your story. n n They imprison you for the rest of your life"); hideElement("btnB"); hideElement("btnA"); showElement("btnStart"); setText("btnStart", "Play Again"); } else { } setText("lblPage","Page Number: "+page) });