I am trying to implement an enemy that would follow players path. For example player is moving around the map (2D) turning left, right, going back and fourth, and then after some time an enemy spawns and it should repeat that exact same path, same turns and so on.
My idea was to record some points every X[ms] and have an enemy move from point to point. But I am not sure if that is the cleanest way to do this. Other idea I had is to record player input but then if speed of enemy would be different then the one of the player it would not work.
Any suggestions are welcome.