Guest User

Untitled

a guest
Oct 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. const READLINE = require("readline-sync");
  2.  
  3. // use whatever properties you want for the player object
  4. let player = {
  5. name: undefined,
  6. courage: 0,
  7. intellect: 0,
  8. strength: 0,
  9. charm: 0,
  10. weapon: "fists",
  11. item: "flashlight",
  12. };
  13.  
  14. console.log();
  15. console.log("*** WELCOME TO THE HAUNTED HOUSE ***");
  16. player.name = READLINE.question("What is your name?: ");
  17. console.log(`${player.name} stands in front of a spooky haunted house.`);
  18. console.log(`${player.name} hears what sounds like screaming coming from inside the house.`);
  19. let enterHouse = READLINE.question("Will you enter the house? (yes or no) ");
  20. if(enterHouse == "y" || enterHouse == "yes") {
  21. player.courage++;
  22. console.log(player.name + 'prepares their ${player.weapon} and opens the door...`);
  23. // continue the story
  24.  
  25. } else {
  26. player.intellect++;
  27. console.log( player.name + 'decides not to open the door. However...`);
  28. // continue the story
  29.  
  30. }
  31. console.log("Thanks for playing!");
Add Comment
Please, Sign In to add comment