Module: BattleRoyal::Playable

Included in:
Player
Defined in:
lib/battle_royal/playable.rb

Instance Method Summary collapse

Instance Method Details

#damageObject



8
9
10
11
# File 'lib/battle_royal/playable.rb', line 8

def damage
  self.health -= 10
  puts "\n#{name} got damaged and now has a health of #{health}"
end

#power_upObject



3
4
5
6
# File 'lib/battle_royal/playable.rb', line 3

def power_up
  self.health += 15
  puts "\n#{name} got a power up!"
end

#strong?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/battle_royal/playable.rb', line 13

def strong?
  self.health >= 100
end