Putting Yourself Together
Alrighty. It's still quite early in the day, plenty time to finish that tile renderer, don't you think? ;-) All I need is some coffee and a nice soundtrack to get me in the mood: Halloween III: Season of the Witch. Hell yeah!
A Good Scare
It seems like that the package cxml
I'm relying on to parse the .tmx
files
is incomplete. :-( I guess that's the appropriate punishment for trying to
write a game in LISP. Of course it goes without saying, that cxml
barely has
any documentation besides the source code itself. This is really bad.
Okay, it's not actually bad. The functionality I was looking for is actually implemented (despite some comments within the code saying otherwise), and I know how to use it now. That was a good scare!
The Moment of Truth
Alright, the tile renderer is basically done now. Let's see if it still works ... Of course it doesn't. Will humans ever be able to write correct computer programs?
About half an hour later, all (of the apparent) bugs seem to have been weeded out. The "game" looks now just as before, which is a good sign. This deserves a commit!
The Torture Never Stops
Of course there were more bugs. There are always more bugs. At least I learned
some more tidbits of Common Lisp knowledge (for example that make-tash-table
compares keys with eql
by default, even if these keys are strings). It also
taught me that seemingly simple things like parsing CSV can be complicated,
given the right circumstances, for example if the file you're reading was
encoded with the Windows convention of using CRLF as an indicator of a line
break, but the package you are using to parse the CSV file just assumes it is
encoded with unix conventions.
It's Alive!
Weeding out the remaining bugs took way longer than I thought, but eventually I managed to complete the tile renderer. There's probably room for optimizations (I'm not very happy with the performance), but at least I've got something resembling a game, at least visually. The map I created is renderer faithfully (except for the "collision" layer which I still need to treat differently), and the character is rendered in the appropriate layer, so that it gets obscured when it moves behind a wall etc.
I initially hoped to be able to complete the tile renderer and the map. At least I achieved one of the two, so I'm quite happy. But now I must go to bed and not repeat the mistakes of previous nights!