Class: GameState

Inherits:
Object
  • Object
show all
Defined in:
lib/game_states/game_state.rb

Direct Known Subclasses

MenuState, PauseState, PlayState

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.switch(new_state) ⇒ Object



3
4
5
6
7
# File 'lib/game_states/game_state.rb', line 3

def self.switch(new_state)
  $window.state && $window.state.leave
  $window.state = new_state
  new_state.enter
end

Instance Method Details

#button_down(id) ⇒ Object



25
26
# File 'lib/game_states/game_state.rb', line 25

def button_down(id)
end

#drawObject



15
16
# File 'lib/game_states/game_state.rb', line 15

def draw
end

#enterObject



9
10
# File 'lib/game_states/game_state.rb', line 9

def enter
end

#leaveObject



12
13
# File 'lib/game_states/game_state.rb', line 12

def leave
end

#needs_redraw?Boolean

Returns:

  • (Boolean)


21
22
23
# File 'lib/game_states/game_state.rb', line 21

def needs_redraw?
  true
end

#updateObject



18
19
# File 'lib/game_states/game_state.rb', line 18

def update
end