Midnight theme

Midnight is a theme for GitHub Pages.


Project maintained by mootootwo Hosted on GitHub Pages — Theme by mattgraham

r/roguelikedev Roguelike Tutorial 2026

Native Javascript, no third party libraries

Part-6

Part-6 of the tutorial is about “Doing and taking damage”. As per Part-5 I am still feeling non-violent. I will follow the tutorial closely, but will make some cosmetic changes so that no one gets hurt.

Part-6 also starts with a large refactor.

Steps

How it went

The first thing I do is fix the typo that was breaking the shadowcasting implementation.

During the refactor, I’m unhappy about a couple of things. First, that I still don’t have a proper event or action queue and I need to work around that not existing. Next that all of the other JS Roguelike Tutorial projects I have been referencing are solidly doing their own thing at this point, and I have no hints from them about this refactor.

The part of the refactor that I couldn’t translate into this project, was moving the event handler out of Engine and into main(). So the #handleEvents() private method and the FOV refresh are still in the engine. It took a lot of troubleshooting to iron out the problems, but this is the complete refactor.

Demo

GitPages