4 ms·
When I see your class definition, I think "why define a whole class for just 1 room?" because then you have to separately define and instantiate every class, an
by natep 14y ago
When I see your class definition, I think "why define a whole class for just 1 room?" because then you have to separately define and instantiate every class, an everything would effectively be a singleton (even if you didn't follow the pattern). If you can treat code as data, and concisely define an anonymous function, it saves a step.
Speaking of code==data and text adventures, I'm currently working my way through the book Land of Lisp[1]. Some chapters just focus on new concepts, but most illustrate concepts through the creation of a game (except for the streams chapter, which has you write a web server). The first game is an extremely basic text adventure. You can only move around and pick up objects, but it did parse 'normal' keyboard input. Now that I'm a few chapters deeper, I'm starting to see how it could be expanded to handle different actions, etc.
Another interesting approach to web-based adventure games is "Adventure Games Live". Instead of typing, you select a radio button for the action you want. Some of those games are extremely challenging (I've spent hours playing and haven't finished many of them)
[1] landoflisp.com
[2] http://www.rinkworks.com/adventure/ http://www.rinkworks.com/adventure/