Class: GameOver
- Inherits:
-
Object
- Object
- GameOver
- Defined in:
- lib/game_over.rb
Instance Method Summary collapse
- #button_down(id) ⇒ Object
- #draw ⇒ Object
-
#initialize(window, death_toll) ⇒ GameOver
constructor
A new instance of GameOver.
- #update ⇒ Object
Constructor Details
#initialize(window, death_toll) ⇒ GameOver
Returns a new instance of GameOver.
2 3 4 5 6 |
# File 'lib/game_over.rb', line 2 def initialize(window, death_toll) @window = window @font = Gosu::Font.new(@window, Gosu::default_font_name, 20) @death_toll = death_toll end |
Instance Method Details
#button_down(id) ⇒ Object
14 15 16 |
# File 'lib/game_over.rb', line 14 def (id) Processor.close if id == Gosu::KbEscape end |
#draw ⇒ Object
8 9 10 11 12 |
# File 'lib/game_over.rb', line 8 def draw @font.draw('It is a draw, both players died', 200, 200, 1) if draw? @font.draw("Player 2 won. Player 1 was blown up by #{killer(:player_0)}", 200, 200, 1) if player_0_hit? @font.draw("Player 1 won. Player 2 was blown up by #{killer(:player_1)}", 200, 200, 1) if player_1_hit? end |
#update ⇒ Object
18 19 20 |
# File 'lib/game_over.rb', line 18 def update # do nothing end |