Re:My first six months of programming: from man-rodent to pa...
by chipsy on Wednesday April 13, 2011 @05:13PM
(#2444223)
Spelunky is made in Game Maker, which lets you script on top of a pre-existing engine and IDE. It's hard to apply to "bare-metal" coding.
I would point to open source games such as Nethack, Stepmania or Battle for Wesnoth for some ideas.
There's Knuth Literate Programming version of the classic Adventure [0] which you can read almost like a novel, and the source code for Spelunky [1] has also been released [2]. (I don't know whether Spelunky has good code, but it's a good game.)
Good luck!
[0] http://www.literateprogramming.com/adventure.pdf [1] http://www.spelunkyworld.com/ [2] http://spelunky.wikia.com/wiki/Source_code