# Dungeon crawler text game

**URL:** <https://www.ruby-forum.com/t/dungeon-crawler-text-game/176793>\
**Category:** Ruby\
**Created:** [October 6, 2009, 10:08am UTC](https://www.ruby-forum.com/t/dungeon-crawler-text-game/176793 "2009-10-06T10:08:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [October 6, 2009, 10:08am UTC](https://www.ruby-forum.com/t/dungeon-crawler-text-game/176793/1 "2009-10-06T10:08:47Z")

</div>

Hey!

So I’m new to Ruby (comming from a Python/C# background) and I love the  
language! So much so, that I want to re-create a text based dungeon  
game.  
I got the basics down with help from a Ruby book I’m reading and I’ve  
upgraded it with many new areas, enemies and some objectives but am a  
bit stumped on how to make it manually navigable. I thought having  
@player.location.connections { player\_move “go south” } might work, but  
it didn’t.

Also, I’m in the process of adding an inventory and items (for quests)  
and am just wondering if using a 4 by 4 array system that the game  
checks for items stored in the array that the player can use, is the  
best way to go about things.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [October 6, 2009, 7:19pm UTC](https://www.ruby-forum.com/t/dungeon-crawler-text-game/176793/2 "2009-10-06T19:19:29Z")

</div>

Here’s a link to a blogpost I wrote for a zork-like text based adventure  
using statemachine and treetop. It handles the “map” and moving various  
directions, as well as inventory… The layout of the adventure/dungeon  
is  
within a yaml file

> **[A “grue”some look at Statemachine and Treetop](http://matthewkwilliams.com/index.php/2008/09/05/a-gruesome-look-at-statemachine-and-treetop/)**
>
> In this blog entry, dear reader, we examine the statemachine and treetop gems via an old standby, a Zork imitation.  And, despite the title, you won’t find a grue. \[crayon-649f32a81d5d5158789…

Hope that helps,  
Matt

–  
“… if you do follow your bliss you put yourself on a kind of  
track that has been there all the while, waiting for you, and the life  
that you ought to be living is the one you are living. When you can  
see that, you begin to meet people who are in your field of bliss, and  
they open doors to you. I say, follow your bliss and don’t be afraid,  
and doors will open where you didn’t know they were going to be.” –  
Joseph Campbell

---

<div class="post-metadata">

**Author:** ![adambeazley](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/5f9b8f/32.png) [@adambeazley](https://www.ruby-forum.com/u/adambeazley)\
**Post date:** [October 6, 2009, 7:45pm UTC](https://www.ruby-forum.com/t/dungeon-crawler-text-game/176793/3 "2009-10-06T19:45:50Z")

</div>

On 2009-10-06, Adam B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Also, I’m in the process of adding an inventory and items (for quests)  
> and am just wondering if using a 4 by 4 array system that the game  
> checks for items stored in the array that the player can use, is the  
> best way to go about things.

Much though I like Ruby, I mostly write these in Inform 6, because it’s  
a language purpose-built for the task. Well, actually. It’s a language  
with a library purpose-built for the task. And it renders to standard  
formats which all the game engines run.

-s
