Pre-course adventure game excercise from Learning Ruby the Hard Way
User moves between rooms in a dungeon, interacts with objects and monsters
Languages | Technologies | Testing Frameworks | Misc |
---|---|---|---|
Ruby | no tests | ||
- The player can move between rooms, pick up and manipulate items, and shoot the monster.
- Room, item and monster Classes inherit off Dungeon_thing generic class
- A big classless loop handles the game mechanics
ruby adventure.rb
no tests
You are in a cluttered kitchen, light streams in through the window.
there is an exit N to dining room
you see item toast
you see monster angry Hobgoblin
please enter instruction (verb, noun)
get toast
you pick up toast
- Methods are too long
- Lacks game object
- Learned about class inheritance
- Control flow and parsing text input
- Rewriting the exercise was useful - improved each time