01 July, 2022

LOX week 1

Wow, this is a lot harder than I thought it would be.

I've been working on the r/rougelikedev 2022 code-along and I thought I could just re-use my code from the Broughlike tutorial and be most of the way there.

I was both right and wrong.

I spent a couple days trying to improve my font loading and canvas creation, which has been a bit of a challenge as still struggle with how JavaScript is both serial and synchronous at the same time, and I have this vague notion that trying to force all of the synchronous bits to be asynchronous is somehow an anti-pattern.

I also spent a couple days discovering that text rendered on canvas is blurry in Chrome.  And apparently also on Firefox on Mac but not Firefox on Win.  This is due to something called subpixel anti-aliasing and there isn't a simple way to turn it off.  One of the best suggestions was to split the text rendering into one layer each for R, G, B, and to render each one of them at a very specific fractional pixel offset.

That wasn't something I was willing to do, so for now I'm just living with blurry characters in chrome until I can decide if I want to render my font into a bitmap spriteset or what.

On the actual software implementation side, the Python 3 / libtcod based tutorial is different both in language and programming paradigms.

The Broughlike tutorial is "quick and dirty" and it gets an amateur up and running very quickly without imposing much in the way of stylistic bias.  There are lots of things that can be improved, but it is left as an exercise for the student to decide just how they want to improve it.

The Python tutorial in this code-along has a very specific style, and it it a little challenging for me to follow and interpret to another language that I am not an expert in.

My code is over at https://mootootwo.github.io/lox/ and gitpages delivers you my implementation notes and "playable" game at https://mootootwo.github.io/lox/ where there are links to what I did in each part.

No comments:

Post a Comment