Looking like a game already


I usually spend much more time thinking than coding, but this week was even more so, and that paid off handsomely. A week's delay is a small price for getting the foundations right in Dungeon Romp.

dungeon romp 3

So, what's the big news?

Of course, the upcoming tasks are yet bigger:

Last but not least, there is something I decided not to do.

As mentioned in the previous update, once you get past a certain line count in JS the language starts showing its limits. But what to do? For a while, I seriously considered rewriting the whole thing in [[CoffeeScript?]]. But when I tried porting the more sophisticated pieces of the code, it turned out to be just as long, if less verbose. Then I considered applying that silly technique where you wrap all your code in one big function, and return from it just what you need. Was about to get started, too, but a brief review of the code made it clear that I was going to gain half a dozen lines or so, and no extra clarity. So that idea got scrapped at the last moment as well.

Turns out, good old refactoring still gives the best results. I should be more worried about the game wooshing past the 1000-LOC mark with no obvious way to split it into modules. But I'll think of something.