i tried various tutorials but i still cant figure out how to make a player stop when hitting a object in the way. it could be a maze or just a simple play area with walls.
if anyone has the knowledge and time it would really help with a detailed explanation on the subject.
you could setup for the keyboard control only direction variables and on the forward or thrust button a speed variable. If you collide overwrite the speed variable to 0 so that if you multiply the direction variable with the speed variable you reach 0 distance in shifting.
e.g
dirx = -1;
myMc._x += dirx *speed;
Of course like Djugan already said, depending on how your game works (concept wise) it can be implemented in many different ways.