New Code Release of the Roguelike Boilerplate
Over the past few weeks I’ve been working hard on updates to the roguelike browser boilerplate. Most of these changes are new functionality I created when developing Asterogue. I’ve back-ported them into this boilerplate so they can benefit everyone who uses it.
Please note that I have not yet updated the PDF guide. I have some more features coming to the codebase in the next couple of weeks, and once those are in I will update the PDF and finish off the last few RBB screencasts.
Here is a full list of the new changes:
-
Cleaned up the inventory code. Previously I had a callback for when inventory items are clicked, but this only makes sense if this was a library. With boilerplate code the developer can just modify the actual function. One level less abstraction makes the code a bit clearer. I also added a function to remove an item from the inventory since this is often required after the player has used an item (e.g. drank a potion, read a scroll).
-
Put the monster into an array. Instead of having a single hardcoded monster I changed the boilerplate to use an array with one monster in it. This makes it easier for a developer to add multiple monsters. With a single hardcoded variable they’d have to go through and find all the places to change it to an array anyway, so this should save on some work.
-
I brought over some pure functions for various tile related logic (“is there a monster on this tile?”).
-
Items are now stored in their own hashmap instead of being stored as tiles in the map hashmap. While developing Asterogue I realized it made more sense to have layers with the floor and wall tile map on the bottom, items on top of that, and then characters and players on the top layer. As a result of this change I also refactored the drawing to become more purely functional.
-
Backported the fixes to the on-screen message log. You can highlight words like “hit”, add multiple messages, and I fixed up the logic so the log persists correctly until the player makes their next move.
-
Improved combat logic and messaging. Player and monster entities are now treated the same in combat (e.g.
combat(player, monster)
andcombat(monster, player)
works the same depending on who is striking who. -
Backported the feature for showing end-screen values like how much XP, gold, etc. the player accrued.
-
Backported the arrows/touch/keyboard handling. During Asterogue dev it was a challenge getting consistent handling of input across all devices. On mobile devices the on-screen arrow buttons are shown, whereas desktop uses the physical keyboard. A bunch of work went into getting a nice consistent feel (e.g. when you hold down a key/button it should feel the same) regardless of the input method being used and I’ve got that working in the boilerplate now.
-
Fixed buggy retro border image artifacts. The NES.css library has this issue where the pixelated rounded corner boxes get bad glitching and artifacts on Chrome, especially on Android. I never worked this out properly on Asterogue but now I finally found a solution that looks good and retains the rounded-pixel corners in the boilerplate.
-
Backported a bug-fix for a bug that an occur at the end of a game when the display has disappeared but some logic might still be running.
-
Backported the animation effects overlay system from Asterogue. Basically what this means is you can add image divs over the top of the game canvas, positioned pixel perfectly. That lets you do CSS effects like particles and stuff on top of the game. In Asterogue this is used for all kinds of game-juice like when you pick up and item or get hit.
I’ve also put the boilerplate on sale for 50% off to celebrate the start of 7DRL (seven day roguelike) 2021 today. Enjoy!
Files
Get Roguelike Browser Boiler plate
Roguelike Browser Boiler plate
Make your browser based roguelike
Status | Released |
Category | Tool |
Author | chr15m |
Tags | Seven Day Roguelike Challenge, boilerplate, Dungeon Crawler, Hack and Slash, My First Game Jam, Pixel Art, project-template, Roguelike, sfxr, Project template |
More posts
- Minimum Viable Roguelike TilesNov 11, 2020
- Update with some fixes and improvementsAug 31, 2020
- Made a gamejam game with RBBAug 31, 2020
- Screencast: how to customize the tileset graphicsAug 26, 2020
- Launch day hooray!Aug 21, 2020
- A walkthrough of the gameAug 20, 2020
- Getting ready for releaseAug 19, 2020
Leave a comment
Log in with itch.io to leave a comment.