Here’s a really interesting article about creating a basic first-person game engine.
http://www.playfuljs.com/a-first-person-engine-in-265-lines/
This guy has a couple of other neat articles about programming / gaming on his site too. Be sure to check it out.