Saturday, April 27, 2013

J.S. Project: Choose Your Own Adventure! (Continued)


Here is my really lame and micro version of the choose-your-own-adventure game. It was inspired by this.

confirm("Ready to play this awesome game?");

var age = prompt("How old are you?");
    if (age > 18) {
        console.log("OK, you're allowed to play, but I'm not responsible for anything that goes wrong.");
    } else {
        console.log("Alllllright. Let's get on with the show, shall we?");
    }
 
// intro
console.log("You are a sloth in the middle of the rainforest. Your goal is to stay alive. Let the first trial begin");

console.log("You feel the sudden urge to use the bathroom.");

var userAnswer1 = prompt("Will you climb down from the safety of your tree to relieve yourself?");
if (userAnswer1 === "yes") {
    console.log("Oh no! A sunbear just appeared from out of nowhere! It seems like you're going to end up for dinner! Uh oh.");
} else {
    console.log("Oops. You just peed all over yourself. Gross.");
}

// feedback
var feedback = prompt("How was the game? I know it was a bit short, but please rate it from 1 - 10!");
if (feedback > 8) {
    console.log("So glad you liked it! Stay tuned for more!");
} else {
    console.log("Boo. You poop.");
}


P.S. Here's a vlog I created today! I'd totally appreciate it if you check it out!! :) 

No comments:

Post a Comment