Point of view

Last night was the inaugural meeting of my new after school study club, and it was a very cosy, pleasant experience. We went around the table and talked about our various works-in-progress, discussed the merits of various database/model frameworks, and eventually settled down to work on our individual projects.

I spent the time getting field-of-view and fog-of-war working in Bones of the Idle. I already had some code from an earlier JS roguelike project to hand, so with a bit of refactoring I was able to slot that into place:

There is nothing insignificant in the world. It all depends on the point of view” — Goethe

The darker areas around the edges represent tiles the player has seen before, but currently cannot see (fog of war), with brighter tiles they can currently see surrounding them. As you can see, their field of view isn’t a perfect circle, as it’s being obscured by the nearby trees.

Now that the player can be placed on the map (which in turn can be larger than the view port, a new feature over the previous code base), the next obvious step is to re-implement pathfinding and get them moving around and scrolling. I still want that to be verified server-side, so again I’m hoping to take the existing code I already have, give it a polish, and drop it in place.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.