Lab 2
This week you are going to make a text based RPG* obstacle course. The theme is all up to you but here are some examples: Get to the end of the month with money left on the bank, Passing the Client-side course, Finding a date on the night club or Make it through the horror forrest.
The main point of this adventure game, is to always move forward or lose. Obstacles can be riddles, coin flips or moral choices. It’s up to you.
Grade 3 requirements
- Use if() and else and at least once, use else if()
- Use the Logical operator: &&
- For communication with the player use any or all of: alert, confirm, prompt.
- There should be at least 7 questions/choices that the player needs to answer correctly, to win.
- Use a random number somewhere (e.g. “Flip a coin” heads or tail?)
- Use a loop to restart or quit the game.
Grade 5 requirements (deadline** Tue, Nov 6, 14:59)
- Use both Logical operators: || and && somewhere in your code (not both at the same time).
- Keep track of how many hurdles the player has passed.
- After each game (win or lose) display the number (or other representation)
- Indicate if that was a hi-score.
- Have a previous answer make an impact on the last hurdle.
Presentation
- Name your lab2_loginname.js and lab2_loginname.html , zip and upload to Pingpong.
- Present your solution at one of the labs to Johan or Domina (thursdays).
* Role Playing Game
** Deadlines mean, after that date, max grade is 3.