Shops!

Happy to announce that shops are more or less done… for now. More like, I’m done with shops, but I’m sure it’s not done with me just yet.

Here we have the general store (don’t buy the broken shield, I heard it gives you no AC bonus) GeneralStore

And to the left of the well, you’ve got the weapon smith selling all sorts of ordinary implements of iron for inflicting pain with. WeaponSmith

This time around, I only spent a day working on the purse logic and tried to keep it simple. The shopkeeper will try to give you sensible change (least amount of coins) so even though their margins are pretty high by anyone’s modern standard, at least you won’t be weighed down by coppers.

Elm bugs

I’ve been really happy with the move to Elm so far. With the shop, alot of my effort and time was spent learning how to write in a functional way and how to structure my data. Very little time was spent fixing bugs. A few has popped up and currently, there is one where if you drop an item back into it’s container, it will create a duplicate.

In the whole shop/pack/equipment/dragdrop/numerous data/module refactoring sessions over the last month, this is the only bug that I’ve been able to find in testing. This is not an experience that I’m used to over the last decade of professional development.

Combat

So I’ve moved on to the combat system.

MonstersInTheVillage

The combat system is an interesting one because it draws from alot of other systems such as the equipment, monster pathfinding, collision detection and probably a few more that I haven’t thought of yet.

In starting this, I’ve had to do a bit more thinking about how I’m representing data. I want to keep these blogs short so I won’t go into details here, maybe in another post, but suffice to say, data representation is quite different in Elm to what I’m used to as well. I’m refactoring old code that I wrote only 4-6 weeks ago as I’m finding better ways to express the same logic and slowly working on the combat system.

Stay tuned for when you’ll actually be able to kill a monster!