Name: Axel 2016-12-18 19:52
Hello My name is Axel and i am making a text based JavaScript game
MY code works perfectly but i don't know how to make an interface for my game, it is a very simply game based on decisions, if you choose x you get x outcome.
Now the only way i know how to change the put comes it to change the value of my variables.
Here is a part of my code:
at the top are the variables that determine the outcome of my story but could someone help me make a way for my users to answer the question with out having to open the code and edit it them selves.
I read about java-script interfaces but i honestly didn't understand any of it, i am very new at programing and this is about what i can do, So please tell me in as simple as possible terms how could i make and interface/ way for them to answer my questions.
Please help i would realy appreciate it!!!
(sory for bad english)
Thank you
MY code works perfectly but i don't know how to make an interface for my game, it is a very simply game based on decisions, if you choose x you get x outcome.
Now the only way i know how to change the put comes it to change the value of my variables.
Here is a part of my code:
var a1= false;
var a2= false;
var a3= false;
var a4= true;
console.log("Theic detective");
console.log(" ") ;
console.log(" ") ;
console.log(" ") ;
console.log("Yourm clock goes of, Do you;");
console.log("1get up" ) ;
console.log("2hit snooze" ) ;
console.log("3Turn it of and keep sleeping" ) ;
console.log("4Shoot it" ) ;
console.log(" ") ;
if (a1 ===true) {console.log("Youout of bed and Katie mumbles: 'have fun at work', you reply: 'Thank you honey.'") ;
}
if (a2 ===true) {console.log("Them rings 5 minutes later and you get up Katie mumbles: 'Have fun at work sleepy head' you mumble 'Thank you'") ;
}
if (a3 ===true) {console.log("Katiees you up 20 minutes later and tells you to hurry or you will be late for work. You jump out of bed");
}
if (a4 ===true) {console.log("'Jesus yells Katie, She drags you to a therapist, there a psychologist determines you have sociopathic tendencies and you are not fit to work as a detective anymore, you leave your resignation to the chief a day later.") ;
console.log();
console.log("Game");
}
at the top are the variables that determine the outcome of my story but could someone help me make a way for my users to answer the question with out having to open the code and edit it them selves.
I read about java-script interfaces but i honestly didn't understand any of it, i am very new at programing and this is about what i can do, So please tell me in as simple as possible terms how could i make and interface/ way for them to answer my questions.
Please help i would realy appreciate it!!!
(sory for bad english)
Thank you