Saturday, October 3, 2015

Chapter 45

  Hello, everyone!

  Just a quick update here,

  Still working away on Zed Shaw's "Learn Ruby the Hard Way" Chapter 45. In this Chapter, the goal is to make a game using classes and modules. Mr Shaw encourages to make this game as complex as you can, and I am really taking it to heart. I gave myself about a week to work on it, and today is Day 8, so I am running a little behind my schedule, but the good news is that the actual code is mostly done. I was going to just go to the next Chapter, but my wife now wants to play the game I made, so I will spend a little bit of time to fill out the "flavor text" in the game, and balance it to make it easier to win.

  At first, I was going to make a simple dungeon crawl game, where you go through the dungeon, fighting monsters until you get to the boss in the end, who you have to defeat to win. It started out simple, where the hero and monster would just have a couple stats (such as HP, Attack Strength Range, and Armor Class).

  Now, after a week of going over the code and adding new features, the Hero of the game will have the following stats:
  - HP: total hit points
  - AC: Armor Class (the monster has to roll higher than AC on a 20sided die to not get blocked)
  - Attack_Range:  the range for the damage Hero deals on a successful hit, will be improved with better weapons and/or spells
  - Crit_Chance: a chance that the damage that the Hero deals will be doubled
 - Hit_Chance: a modifier that will help the Hero to avoid being blocked by a monster
 - Wisdom: this will improve the strength of the Hero's Spells and will help detect traps
 - Gold: as Hero defeats monsters, he also collects gold that can be spent on better gear and health potions.

  Hero can cast spells during combat that will do damage, or increase his stats for the duration of the combat. Hero can also find a bow during the game, and will be able to deal ranged damage before actual combat begins.

  Also when the game starts, a player has to choose a specialization for a Hero: Strength, Dexterity or Wisdom. Depending on the Choice, certain stats will be increased for the newly created Hero.
For example, Strength will increase HP, AC and Attack Strength.

  This is what my Hero Class looks like now:

Passing 6 parameters in a little much, but I figured that I am only creating one instance of this class, so it might be ok in this case.

Here is what my Monster Class looks like:

Many instances of the class Monster will be created during the game, so there are only two parameters, with the second one being a hash "options", that will hold all of the monsters stats. If the hash does not contain a specific stat, the default values for the stat will be used.

All in all, I am pretty excited to get this game finished, and move to the next Chapters. Tomorrow, my goal is to have all the code 100% complete and working, so that I can start next Chapter. I might have some flavor text left to fill out, and work on fight balancing, but I can do that in my spare time from coding.

Have a great day everyone, and thanks for reading my blog!


No comments:

Post a Comment