quarta-feira, 25 de junho de 2014

Jogos

Aproveitando o ritmo do último post, lá vai mais um joguinho criado no CodeAcademy.


//Check if the user is ready to play!
confirm("Você está pronto para jogar?");
//Age
var age = prompt("What's your age?");
if (age >= 18)
{
console.log ("Divirta-se");
}
else
{
console.log("Não me responsabilizo por seus atos");
}
//História
var Intro = "Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.";
console.log(Intro);
//First
console.log("Batman glares at you");
var userAnswer = "Are you feeling lucky, punk?";
prompt(userAnswer);
//Go ahead
if (userAnswer === "Yes")
{
console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
}
else
{
console.log("You did not say yes to feeling lucky. Good choice! You are a winner in the game of not getting beaten up by Batman");
}
//Feedback
var feedback = prompt("Feedback");
if (feedback > 8)
{
console.log("This is just the beginning of my game empire. Stay tuned for more!");
}
else
{
console.log("I slaved away at this game and you gave me that score?! The nerve! Just you wait!");
};

0 comentários:

Postar um comentário