js代写

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

  1. Use if() and else and at least once, use else if()
  2. Use the Logical operator: &&
  3. For communication with the player use any or all of: alert, confirm, prompt.
  4. There should be at least 7 questions/choices that the player needs to answer correctly, to win.
  5. Use a random number somewhere (e.g. “Flip a coin” heads or tail?)
  6. Use a loop to restart or quit the game.

Grade 5 requirements (deadline** Tue, Nov 6, 14:59)

  1. Use both Logical operators: || and && somewhere in your code (not both at the same time).
  2. Keep track of how many hurdles the player has passed.
    1. After each game (win or lose) display the number (or other representation)
    2. Indicate if that was a hi-score.
  3. Have a previous answer make an impact on the last hurdle.

Presentation

  1. Name your lab2_loginname.js and lab2_loginname.html , zip and upload to Pingpong.
  2. 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.