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.


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


Building a Roguelike in Javascript - Part 5b

Attacking Spreading Fungi

This is the seventh 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 fifth part in Trystan's series. All the code for this part can be found at the part 5b tag of the jsrogue repository. At the time of writing, I am still using the d4ea2ab commit for rot.js.

Today we're going to make it so that we can interact with our fungi! We're going to add a basic attack system which will simply remove an entity when our player attacks it. For those unfamiliar with roguelikes, attacking is generally done by bumping into or moving into the entity we wish to attack. We're also going to make the fungus entity spread randomly over time, eventually taking over our cave unless our hero chooses to rise to the task and attack every fungus!

Demo Link

The results after this post can be seen here


Building a Roguelike in Javascript - Part 5a

Populating the Cave

This is the sixth 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 fifth part in Trystan's series. All the code for this part can be found at the part 5a tag of the jsrogue repository. At the time of writing, I am still using the d4ea2ab commit for rot.js however there seemed to be an error in the rot.min.js file included in the github repository (it was missing ROT.Scheduler.Simple) so I fetched it again from the same commit. You may need to do the same. It can be obtained here.

Today's going to be an exciting post! We are going to add more entities to our cave so that the player is not alone! This is going to be a pretty significant step towards populating our cave with a variety of terrifying monsters. To keep it simple our first monster will be a fungus. This fungus won't move for the moment and we can't currently walk through it, but in the next post it will spread over time and we'll be able to clear it by walking through it! I'm warning you ahead of time - this post is quite long, but builds some pretty fundamental stuff.

Demo Link

The results after this post can be seen here