Method: StudioGame::Player#found_treasure
- Defined in:
- lib/studio_game/player.rb
#found_treasure(treasure) ⇒ Object
comparing the current player’s score to default score which is (health=100 + name=0), or 100. for the 3 scores, it will rank the scores by which value is biggest compared to 100. ie, [50,105, 65], will be -1, 1, -1 when returned as an array it shows as [105, 65, 50]
36 37 38 39 40 |
# File 'lib/studio_game/player.rb', line 36 def found_treasure(treasure) @found_treasures[treasure.name] += treasure.points puts "#{@name} found a #{treasure.name} worth #{treasure.points}." puts "#{@name}'s treasures: #{@found_treasures}" end |