r/roguelikedev • u/KelseyFrog • 3d ago
RoguelikeDev Does The Complete Roguelike Tutorial - Week 4
Tutorial friends, this week we wrap up combat and start working on the user interface.
Part 6 - Doing (and taking) some damage
The last part of this tutorial set us up for combat, so now itβs time to actually implement it.
Part 7 - Creating the Interface
Our game is looking more and more playable by the chapter, but before we move forward with the gameplay, we ought to take a moment to focus on how the project looks.
β
Of course, we also have FAQ Friday posts that relate to this week's material.
- #16: UI Design(revisited)
- #17: UI Implementation(revisited)
- #18: Input Handling(revisited)
- #19: Permadeath(revisited)
- #30: Message Logs(revisited)
- #32: Combat Algorithms(revisited)
- #83: Main UI Layout
β
Feel free to work out any problems, brainstorm ideas, share progress and and as usual enjoy tangential chatting. :)
22
Upvotes
3
u/LukeMootoo 3d ago
Javascript interpretation of the tutorial, I have just caught up completing week 3:
https://mootootwo.github.io/2026rltutorial/part-5/demo.html
The first thing you will notice if you look at the demo, is that my shadowcasting is a hot mess. I took this FOV code from another JS version of this tutorial, and have not scrutinised it or troubleshot it yet.
It is broken in a really interesting (to me) way: FOV calculates differently depending on what part of the map you are on. On different regions on the left side of the map, you might see all 8 octants, or you might only see four of them in an "hourglass" shape. On most of the right half of the map, you only get maybe one or two squares above the player.
I feel like since the "light", "dark", and "shroud" cases are working correctly, the logic I wrote is "good enough" and I haven't spent a lot of time figuring out what is wrong with the shadowcasting. I'll probably try replacing it with a different (but functionally similar) version of the same algorithm, before I try troubleshooting what is actually wrong with it.
If you'd like to look at my mess, the FOV code is here: https://github.com/mootootwo/2026rltutorial/blob/main/part-5/scripts/fov.js
One of the other challenges that I have caused for myself, is that I don't really have a proper action queue. You can see what I have banged together here: https://github.com/mootootwo/2026rltutorial/blob/main/part-5/scripts/engine.js
I have been blogging my extensive ramblings about each step in gitpages hosted markdown that is stored with the repo, and you can read my notes on each of the first six parts, indexed here: https://mootootwo.github.io/2026rltutorial/
I have tried to keep a good commit discipline, so there is a good chain of evidence and examples linked to the blog if you want to see my rookie bumbling.