Ok, so, you could use ectors, or as lucas said, int x, y, z;
Maybe something along the lines of this. This code wouldn't work correctly but screw off.
int x, y, z; //the players coordinates.
int jumping; //we'll just have this here in case you wanta make jumping;
//declare some sounds
sound step; sound jump; sound ambience;
void main() //hope I don't gotta explain this.
//load the sounds.
while(key_pressed(KEY_ESCAPE)=false) //Declare that the following will occur if the key escape is pressed.
move(forward); //call the move void, with the directcion of forward.
//do that for all the arrows.
void move(string direction) //call a move function, that will take the direction that you move.
Now that was thrown together in 5 minutes, and I don't even think that would work, considering I have a vary limited grasp on loops, for some reason they won't work for me, and that I'm not sure if I did the void with an enclosed var correctly. Please correct me if I did that rong, cause I'd love to learn myself.
“I thought he’d never leave.” Vex’ahlia, Critical Role Campaign 1, Episode 81
“We’re gods. It’s fine.” Keyleth, Critical Role Campaign 1, Episode 97
“From the stands, I lift up my shirt and I say, ‘I love you, Grog!’” Vex’ahlia, Critical Role Campaign 1, Episode 23