Class: Fet::Ui::Score
- Inherits:
-
Object
- Object
- Fet::Ui::Score
- Defined in:
- lib/fet/ui/score.rb
Overview
Shows the UI elements for score
Instance Attribute Summary collapse
-
#game ⇒ Object
Returns the value of attribute game.
-
#score ⇒ Object
Returns the value of attribute score.
-
#text ⇒ Object
Returns the value of attribute text.
Instance Method Summary collapse
- #handle_event_loop(event) ⇒ Object
- #handle_update_loop ⇒ Object
-
#initialize(game) ⇒ Score
constructor
A new instance of Score.
- #start ⇒ Object
Constructor Details
Instance Attribute Details
#game ⇒ Object
Returns the value of attribute game.
11 12 13 |
# File 'lib/fet/ui/score.rb', line 11 def game @game end |
#score ⇒ Object
Returns the value of attribute score.
11 12 13 |
# File 'lib/fet/ui/score.rb', line 11 def score @score end |
#text ⇒ Object
Returns the value of attribute text.
11 12 13 |
# File 'lib/fet/ui/score.rb', line 11 def text @text end |
Instance Method Details
#handle_event_loop(event) ⇒ Object
24 25 26 27 |
# File 'lib/fet/ui/score.rb', line 24 def handle_event_loop(event) handle_level_started_event(event) handle_level_complete_event(event) end |
#handle_update_loop ⇒ Object
29 |
# File 'lib/fet/ui/score.rb', line 29 def handle_update_loop; end |
#start ⇒ Object
19 20 21 22 |
# File 'lib/fet/ui/score.rb', line 19 def start self.text ||= generate_text update_text end |