Strangely Consistent

Musings about programming, Perl 6, and programming Perl 6

July 17 2012 — getting things from the car

Having created enough of the game engine, I now have a very pleasant DSL-like thing in which to write crypt. Today in my commits I could write

.place_thing('car', 'clearing');

And then

.place_thing('flashlight', 'contents:car');
.place_thing('rope', 'contents:car');
.make_thing_openable('car');

This is much nicer than last year. And more flexible, as I hoped.

I found that in last year's game, I can examine the flashlight (which is in the car), even without opening the car and revealing the flashlight. Now, you might say, maybe the car has windows, but that wasn't the intent. I consider it a bug, caused by hard-to-follow placement logic. Let's do better this year.

That's it for today. So what does the game look like now?

$ bin/crypt 
CRYPT
=====

You've heard there's supposed to be an ancient hidden crypt in these
woods. One containing a priceless treasure. Well, there's only one way
to find out...

Clearing

The forest road stops here, and the gaps between the trees widen into a
patch of un-forest. The sky above is clear apart from a few harmless clouds.
You can go east.

> examine car
Small, kind of old, and beginning to rust. But it still gets you places.

> examine flashlight
You see no flashlight here.

> open car
Opening the car reveals a flashlight and a rope.

> examine flashlight
You see no flashlight here.

> take flashlight
Sorry, I did not understand that.

> quit

Well, we're not repeating last year's error, for sure. But the last two responses are wrong. Also, the car should appear in the description of the room. Let's fix all those things tomorrow.