Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Final Project</title>
- <script>
- function getPlayerName(){
- alert("Welcome player to World Of WarCraft");
- var reply = prompt("What is your name?");
- return reply;
- }
- function startLevelOne(name){
- var score = 0;
- alert("Today You Will Be training");
- var enter = prompt("Are you sure you want to do this").toLowerCase();
- if(enter == "yes"){
- alert("Good, you will now enter the Training Zone Adventure awaits!");
- score += 25;
- } else {
- alert("You Do Not wish to Train.Then Your journey ends here.");
- score -= 0;
- endGame(score);
- }
- alert("before you joined the knights we checked your profile your element is lightning correct");
- var question = prompt("Is That Your Element").toLowerCase();
- if (answer == "yes"){
- alert("Then we were correct as always");
- }
- else {
- score -= 25;
- endGame(score);
- }
- return score;
- }
- function endGame(score){
- alert("Game over!");
- alert("Your score is: " + score);
- }
- function play(){
- alert("Game Started:");
- var name = getPlayerName();
- alert("Welcome " + name + "!");
- var score = startLevelOne();
- endGame(score);
- }
- </script>
- </head>
- <body>
- <h1>World Of WarCraft</h1>
- <input type="button" value="Start Game" onclick="play()" />
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement