FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!

CodeAcademy's Javascript game




This game is a very simple game that was taught to users at CodeAcademy:
Code:
// Check if the user is ready to play!
confirm("Are you ready to play?");
var age = prompt("What's your age?");
console.log(age);
if(age >17)
{
   alert("Welcome");
}
else
{
   alert("This game is not intended for users under 18. You are allowed to play at your own risk");
}
console.log("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("Batman glares at you.");
var userAnswer = prompt("Are you feeling lucky, punk?");
if(userAnswer = "Yes")
{
   console.log("Batman hits you very hard. It's Batman and you're you! Of course Batman wins!");
}
else
{
   console.log("Good choice! You are a winner in the game of not getting beaten up by Batman");
}
var feedback = prompt("Please rate this game from a scale of 1-10");
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!")
}

From:http://www.codecademy.com/courses/javascript-beginner-en-x9DnD/0?curriculum_id=506324b3a7dffd00020bf661#!/exercises/6 (Requires logging in)



2 blog comments below

you can only claim you write your first games if it's your original idea and write it from scratch. not if you copy it from codecademy.com

also, what happen if the player do not have javascript console open (like 99.9999999% of normal user)? how the heck are they going to see the message?
badai on Wed Mar 20, 2013 8:09 am
I already fixed it and gave the proper credits. Thank you for informing me about this and I apologise for this. A way to solve this problem is to put the entire storyline on popups so that users without Javascript console as what you mentioned, would be able to view it.
twotrophy on Wed Mar 20, 2013 2:11 pm



FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.