Class: Asteroids::GameState

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

Direct Known Subclasses

MenuState, PlayState

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.switch(new_state) ⇒ Object



4
5
6
7
8
# File 'lib/asteroids/states/game_state.rb', line 4

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



26
27
# File 'lib/asteroids/states/game_state.rb', line 26

def button_down(id)
end

#drawObject



16
17
# File 'lib/asteroids/states/game_state.rb', line 16

def draw
end

#enterObject



10
11
# File 'lib/asteroids/states/game_state.rb', line 10

def enter
end

#leaveObject



13
14
# File 'lib/asteroids/states/game_state.rb', line 13

def leave
end

#needs_redraw?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/asteroids/states/game_state.rb', line 22

def needs_redraw?
  true
end

#updateObject



19
20
# File 'lib/asteroids/states/game_state.rb', line 19

def update
end