Arduino based 20x4 LCD game device

Here are some pics of a little device I made. My son(9) and I made a text adventure game on it as a birthday present for his cousin.

http://picasaweb.google.com/benwilk/ArduinoTextAdventure?authkey=qRspOKjzijQ#

Ben

Wow, that's a really thoughtfull present. Hope it's well received.

Would you be able to upload the code? As it seems it would be quite a long and complicated program - so it sounds interesting!

Ben D

Well, I would like to clean up the code before I put it out for the world to see ;-0

Right now I am loading the extra EEPROM by loading 4 different sketches that just hold strings and a small routine that pushes them onto the EEPROM. There is a lookup table of pointers to these strings that gets placed at a different place on the eeprom. I would like to change this to pull all the data out of 1 file streaming thru serial.

After loading the EEPROM I load the sketch for the game, which just has routines like "savegame()" and "displaymenu()" and "onmove()"

The basic logic of the game is super simple but works pretty well. Each object has a name string,description string,and resultingstring and well as a location (a room number), bportable (a boolean 1 if able to be picked up), ACTION mask (what can be done with it, like USE or FIGHT), catalystitem (number if item that can be used with it), resultingitem(item that replaces it after use)

The rooms just have name, description, and 6 integers for each exit direction (N,S,E,W,Up,Down). A zero value means no exit that way.

Thats basically it, with a few hacks.
In the game one puzzle (for example) is a statue of Demeter holding a empty vase. Somewhere else you find dirt (you actually have to clean the floor of the princess because she thinks you are the maid). If you use the dirt with the statue, the resulting string is "You place the dirt in the vase". Both the statue and the dirt are removed from the game and the resulting object is statue2. Of course the player doesnt know it's statue2, and just sees "Demeter", but when examining now the description reads "..She is holding a vase full of dirt." So then you must use the magic seeds (found elsewhere) with statue2 to make statue3, and finally add water to get a vine to grow and open up a exit UP.

The cousin(8) wants to write his own games for this, so the best thing would be to write a program where he could put together his ideas graphically and then have it generate a script that could be loaded up to the EEPROM. Heh, the gift that keeps on giving :wink:

Ben