In this project, the pink square uses ray-casting to find out where the purple square is. Use WADS to move the purple square. It's not perfect, if the pink square doesn't have sight of it's target it doesn't do much.
THIS IS NOT A GAME!!! I was just playing around with some code and thought I'd share it. There is no way to win and no way to lose. Feel free to use with credit.