You may want to go look up ti85calc's spooky maze on smilebasicsource. If I remember the game has a raycasting library. But basically you would have a map array with block codes. you would also have an x, y position and rotation of the character, and a way to map that to your block array. Using trig send out virtual rays from angle - field of view to angle plus field of view. You find intersecting