hi, im new to delphi and really need some help.

basically, i have a map thats layed out on my screen in tiles to produce a sort of overhead view of some corridoors and at the end is the goal the player is trying to reach.

ive coded in two ways of moving the character. Basically you can click and a tile and the character will move there but i dont know how to make it so the character can only move so far as one step infront of him.

so i opted for the movement to be based on the normal, up down left right keys. the guy moves and all but i wouldnt have a clue how to stop the guy from going through the tile that represents a wall. is this even possible? if its not please explain to me a better way of making my game.

thanks,
big_b