Skip to content

Commit

Permalink
Put gameover message above everything else (and stop the @Timer as well)
Browse files Browse the repository at this point in the history
  • Loading branch information
karmi committed Dec 11, 2008
1 parent bf1e5c0 commit ae66ab5
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions sheep_in_your_shoes.rb
Expand Up @@ -105,16 +105,12 @@ def run!(direction)
@pasture = SheepInYourShoes::Pasture.new(25)

def game_is_over(message)
@finale.replace(message)
@finale = title(message, :stroke => '#082299', :fill => '#fff', :align => 'center')
@finale.move 0, 150
@finale.show
@timer.stop
end

def game_over?
@game_over
end

animate(30) do
@timer = animate(30) do
unless @pasture.empty?
@sheep = @pasture.random_sheep
@sheep.run! if @sheep
Expand All @@ -129,7 +125,4 @@ def game_over?
@pasture.remove_sheep_on(@pasture.dog.x, @pasture.dog.y)
end

@finale = title "Game Over!", :stroke => '#082299', :fill => '#fff', :align => 'center'
@finale.hide

end

0 comments on commit ae66ab5

Please sign in to comment.