Ok, to start with, raycasting like in Wolfenstein-3D or Spooky Maze isn't really 3D, it just looks 3D. For this type of game, the world is a two dimensional grid. Each location on the grid is either one of various wall types or an empty section of floor. Each wall type has a texture/image. Easy so far, I hope. The player is at a point in the game world and is looking in a direction.