-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.js
49 lines (40 loc) · 999 Bytes
/
game.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Require Word
var Word = require('./word.js');
var inquirer = require("inquirer");
//Game Constructor
function Playhangman() {
// New Hangman Word instance
this.game = new Word();
//
this.theme = function(){
inquirer.prompt([
{
name: "theme",
type: "list",
message: "Pick a theme, your Hangman Game will choose a word based on that theme",
choices: ["Pro Wrestling", "Movies", "Musicians"]
}]).then(function(answers){
this.chosenTheme = answers.theme;
});
};
// Set Difficulty Level
this.difficultyLevel = 10;
// Choose Difficulty Function
this.difficulty = function(){
inquirer.prompt([
{
name: "difficulty",
type: "list",
message: "Choose a difficulty setting, this will affect your number of guesses.",
choices: ["Easy = 10", "Hard = 5", "Sudden Death = 1"]
}
]).then(function(answers){
this.difficultyLevel = answers.difficulty;
});
};
};
function Playhangman(){
this.theme
this.difficulty
}
module.exports = Playhangman;