I useful thing to think of when working with x and y variables. Is how to create complex worlds with different locations i.e a town could open up on a new set of axis. example:
Code:
int World_1_X, World_1_Y;
int Town_1_X, Town_1_Y;
To enter a new town you would need a variable to check where the user was via setting the variable to the relavent number I use the name "User_Location". for example lets say Town_1 was at:
World_1_X = 4 World_1_Y = 2
Code:
if(World_1_X = 4 && World_1_Y = 2 && User_Location == 1)
{
User_Location == 2; //Number assigned prior for the town
}
If your making games like this it's a good idea to provide maps for users to look at, also a display co-ordinates option.
Anyhow, I hope this helps.