Class: StudioGame::ClumsyPlayer
- Defined in:
- lib/studio_game/clumsy_player.rb
Overview
clumsy player class
Instance Attribute Summary
Attributes inherited from Player
#found_treasures, #health, #name
Instance Method Summary collapse
- #boost ⇒ Object
- #found_treasure(name, points) ⇒ Object
-
#initialize(name, health) ⇒ ClumsyPlayer
constructor
A new instance of ClumsyPlayer.
Methods inherited from Player
from_csv, #points, #score, #to_s
Methods included from Playable
Constructor Details
#initialize(name, health) ⇒ ClumsyPlayer
Returns a new instance of ClumsyPlayer.
8 9 10 11 |
# File 'lib/studio_game/clumsy_player.rb', line 8 def initialize(name, health) super(name, health) @boost_factor = 5 end |
Instance Method Details
#boost ⇒ Object
18 19 20 |
# File 'lib/studio_game/clumsy_player.rb', line 18 def boost @boost_factor.times { super } end |
#found_treasure(name, points) ⇒ Object
13 14 15 16 |
# File 'lib/studio_game/clumsy_player.rb', line 13 def found_treasure(name, points) points /= 2 super(name, points) end |