Module: Wackelkoepfe::GameTurn

Defined in:
lib/Wackelkoepfe/game_turn.rb

Class Method Summary collapse

Class Method Details

.take_turn(player) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/Wackelkoepfe/game_turn.rb', line 8

def self.take_turn(player)
    die = Die.new

    case die.roll
    when 1..2
      sleep(1)
      player.blam
      sleep(1)
    when 3..4
      sleep(1)
      puts "#{player.name} wurde uebersprungen."
      sleep(1)
    else
      sleep(1)
      player.w00t
      sleep(1)
    end

    treasure = TreasureTrove.random
    player.found_treasure(treasure)  
end