Dynamically storing properties depending on position
Okay i am creating a tile based game, everytime i move the character i want to store his walking direction for example dirx = 1 , diry = 0. The idea being that when my enemies reach a tile where the character has been it can load the directions and walk the same way. How do i associate the directions with the current tile?
Something like this is my idea but i dont know how to actually program it.
private var giveTileDirections():void
{
var xdir = this.dirx;
var ydir = this.diry;
}
Thanks in advance
