Module: Fet::Ui::GameLoopHandler

Included in:
Game
Defined in:
lib/fet/ui/game_loop_handler.rb

Overview

Handles various events and updates for the Game object

Instance Method Summary collapse

Instance Method Details

#handle_event_loop(event) ⇒ Object



15
16
17
18
19
20
21
22
23
24
# File 'lib/fet/ui/game_loop_handler.rb', line 15

def handle_event_loop(event)
  handle_keyboard_event(event)

  # NOTE: score must handle event before level because level event could recreate the whole level
  score.handle_event_loop(event)
  level.handle_event_loop(event)
  timer.handle_event_loop(event)

  handle_custom_events
end

#handle_update_loopObject



9
10
11
12
13
# File 'lib/fet/ui/game_loop_handler.rb', line 9

def handle_update_loop
  score.handle_update_loop
  level.handle_update_loop
  timer.handle_update_loop
end

#set_level_complete_event_flagObject



34
35
36
# File 'lib/fet/ui/game_loop_handler.rb', line 34

def set_level_complete_event_flag
  self.level_complete_event_flag = true
end

#set_level_started_event_flagObject



30
31
32
# File 'lib/fet/ui/game_loop_handler.rb', line 30

def set_level_started_event_flag
  self.level_started_event_flag = true
end

#set_note_selected_event_flagObject



26
27
28
# File 'lib/fet/ui/game_loop_handler.rb', line 26

def set_note_selected_event_flag
  self.note_selected_event_flag = true
end