Showing posts with label hit points. Show all posts
Showing posts with label hit points. Show all posts

Level Up

I implemented character levels today. The player starts out at level 25, a relatively high level. I did this so we can skip the boring low level character advancement. I also wanted to give the player a chance to surive the harsh dungeon environment. This does not mean the game will be an easy win. You will just have a chance.

Along with character levels comes the opportunity to advance levels. I let the character gain the first couple character levels with ease. You just need to kill a few monsters. It gets harder and harder to advance after a while. I generously add more hit points to your maximum hit points when you gain a level.

In other news, I have been fixing some bugs I found. For example, when a monster was close to death, I got some errors computing damage that the monster did when hitting the character. This was because the damage done is based on the amount of hit points the monster has. I guess the random number generator does not want the range of random numbers to be too small.

Pretty soon I will have to add some more dungeon levels. I will also finally need to add unique monsters. With them will come the need for unique treasures (such as weapons and armor). A lot has been done. But there is so much more to do. Onward.

Battle Engine

I have started implementing the battle portion of my roguelike game engine. There are a lot of variables involved. To determine whether you hit a monster, you must take the monster armor class into account. You must also factor in any bonus to hit with the weapon.

Once you do strike a monster, you must determine the damage inflicted. I check the weapon you are wielding. It will do some base damage, along with any bonus damage. And if we are doing damage, the monster must have some hit points.

So far I do not have the monsters fighting back. But that should be the reciprocal activities as when the player attacks the monsters. Of course if the player runs, the monsters will most likely follow. Not sure if I want to add regeneration to the player and monster hit points yet.

So far progress is pretty darn good. I don't know whether my battle system is the exact mechanics done with Dungeons and Dragons. But it is good enough for my game engine for now. The main thing I am testing for is whether the time it takes to kill certain monsters feels right.

Roguelike Next Steps

I performed a redesign on the code for my roguelike game engine. Changed the way I stored items that were in the player's inventory or equipment list. This made a lot of the routines simpler and more generic. Now I have the power to implement additional items such as potions, rings, amulets, and wands.

But I think I might change directions. Implementing more items is just an extension of what I have already. I need something new. I think it is time to add monster opponents into the game engine.

Monsters have some different behavior. They fight you. That adds some real time battle code. Right now the controls are just the player moving around the dungeon and interacting with items. I got to consider monster movement now as well. Also need to implement the hit points system for both players and monsters. Let's see where this leads.

Monsters

The last item I had to add to my JSRL roguelike game was monsters. This proved to be a challenging task. It was easy to randomly place monster characters in the dungeon. But then I needed to code the monsters to become aware of the player. Then the monster needed to chase the player.

The addition of monsters also required battles. I added the ability for the player to attack the monsters. The monsters needed to be able to attack the player as well. This required me to track the hit points of the player and all monsters. It also required me to start providing messages to the user based on the results of the fight.

There is not much functionality to add. I should test the game in browsers other than Internet Explorer such as Firefox. Then I would like to put a title screen in there. Finally I shall upload the game to a site where everyone can access it. Get ready for some fun.