We are going to model a game that is set in Medieval Times. Along the way we are going to create:
A Person class that is the "root" of the class hierarchy
- Attributes
first_namelast_namefull_name
A Player class that is a subclass of the Person class.
- Attributes
health, defaults to 20strength, defaults to 5alive, default is true. A player will be dead if his/her health reaches zero
- Methods
take_damage(attack_strength): subtract the attack_strength from the recievers health.attack(player): call the player's take_damage method passing the attackers strength as an argument.
A Knight will be a subclass of the Player class.
- It's default
healthwill be 50 - It's default
strengthwill be 7
A Wizard will be a subclass of the Player class.
- It's default health will be 20
- It's default strength will be 75
- Fork and clone this repo, change into the
ruby_assessment_objectsdirectory. - Run
bundle install - Create a game program (in
lib/asessment.rb) that will model a battle/fight between players, knights and wizards. Don't need user input, unless you feel you want to. - On Github, initiate a Pull Request to turn in your assessment