Error Code CS0103 The name ‘states’ does not exist in the current context. (71,35)
I’m pretty new to coding in general and i’m having a hard time finding out what is wrong with my code.
Here are lines 35-72. its a simple text/dungeon game that i quickly through together just for fun.
state_freedom();
} else if (myState == States.bed_2) {
state_bed_2();
} else if (myState == States.bed_3) {
state_bed_3();
} else if (myState == States.bed_4) {
state_bed_4();
}
}
void state_cell (){
text.text = "Hello, I am Bro Bot 9000 and you are trapped in a cell." +
"I am here to asist you in your escape. Are you ready to Begin?" +
"Good because were starting anyway, there is a bed a mirror and a window.
" +
“Press B to look at bed, Press M to look at Mirror, Press W to look out window” ;
if (Input.GetKeyDown (KeyCode.B)) {
myState = States.bed_0;
} else if (Input.GetKeyDown (KeyCode.M)) {
myState = States.mirror;
} else if (Input.GetKeyDown (KeyCode.W)) {
myState = States.window_0;
}
}
void state_bed_0 (){
text.text = “Wow this bed is absolutely disgusting, you should really consider washing it.” +
"Oh wait your a prisoner, right.
" +
“Press C to go back to searching the cell, Press B to keep looking at the bed” ;
if (Input.GetKeyDown (KeyCode.C)) {
myState = States.cell;
} else if (Input.GetKeyDown (KeyCode.B)) {
myState = States.bed_2;
}
}
void state_bed_2 (){
text.text = "Is that pee?.
" +
“Press B to look even closer” ;
if (Input.GetKeyDown (KeyCode.B)) {
myState = states.bed_3;
}
}