Building a Roguelike in Javascript - Part 8b

Remembering the Cave Layout

This is the eleventh post in the Building a Roguelike in Javascript series. I recommend you start at the beginning unless you've been following along. This part corresponds to the second part of the eight part in Trystan's series. All the code for this part can be found at the part 8b tag of the jsrogue repository. At the time of writing, I am still using the d4ea2ab commit for rot.js. Note that I have done some aesthethic cleanup to the code between part 8a and this part. This has not changed functionality and merely fixed some style issues such as not ending all declarations with semicolons.

In the last part we added a field of vision to limit what the hero would see at any given point in time. In this post we will be making it so that our hero remembers the parts of the cave that have been previously visited. If a tile has been visited before but is not currently in the field of vision, it will appear however any entity that may be on the tile will not! These tile will also appear in gray in order to show the current field of vision.

Demo Link

The results after this post can be seen here.


Building a Roguelike in Javascript - Part 8a

Shadows in the Cave

This is the tenth post in the Building a Roguelike in Javascript series. I recommend you start at the beginning unless you've been following along. This part corresponds to the eight part in Trystan's series. All the code for this part can be found at the part 8a tag of the jsrogue repository. At the time of writing, I am still using the d4ea2ab commit for rot.js.

The cave in our game currently isn't all that much fun to explore as we can see the entire cave right away. In this post we will be adding a 'field of vision' to the cave, meaning our hero will only be able to see what is in his direct surroundings. In part 8b our hero will also remember what's been seen before however any monsters or items that are in those areas will remain hidden in the shadows until we re-visit them. This is going to give the cave more atmosphere and will make it much more fun to explore.

Demo Link

The results after this post can be seen here.


A Small Update

Hello everyone! It's been quite a while since my last post and I just wanted to update everyone on what's been going on. I have been quite busy lately as I have moved and started a summer internship. I have not given up on the 'Building a Roguelike in Javascript' series however it will be a while before I can continue it.

Along with this announcement, I have added a personal disclaimer to this site. To repeat it: I am Dominic Charley-Roy. This is is my personal website. The views and opinions expressed on this site are mine alone and are not representative of my current employer. This also holds for any communication I may have with you, the reader, whether it be in person or through the internet.

Although I may not have time to write a new post for a while, please feel free to post any comments or questions you may have and I will gladly answer them. I also encourage you to fork the jsrogue source and to play around with it.

Thank you for reading,

Dominic


Building a Roguelike in Javascript - Part 7

Deeper Into The Cave

This is the ninth post in the Building a Roguelike in Javascript series. I recommend you start at the beginning unless you've been following along. This part corresponds to the seventh part in Trystan's series. All the code for this part can be found at the part 7 tag of the jsrogue repository. At the time of writing, I am still using the d4ea2ab commit for rot.js.

Our game currently has one simple level. In this post we are going to make our cave have a third dimension allowing our hero to venture deeper and deeper into the cave! I am going to take Trystan's approach of creating the entire world at once, allowing us to freely roam through the various levels without encountering loading screens / delays. This is going to be a long post as there is quite a lot to change, but hang in there - it will be worth it. I'd hate to finish a post without you have a working game, so I'm not going to split it into two parts.

Demo Link

The results after this post can be seen here


Building a Roguelike in Javascript - Part 6

Combat and Messages

This is the eight post in the Building a Roguelike in Javascript series. I recommend you start at the beginning unless you've been following along. This part corresponds to the sixth part in Trystan's series. All the code for this part can be found at the part 6 tag of the jsrogue repository. At the time of writing, I am still using the d4ea2ab commit for rot.js.

In the last post we introduced basic combat allowing our hero to whack down any pesky fungi by simply bumping into them. We're now going to make this combat system a bit more realistic, giving attack and defense stats to entities and adding a bit of a random factor to attack damage. As we play our game we're also going to want to know what's going on so we're going to add a simple way to show messages on the screen.

Demo Link

The results after this post can be seen here