Class: Petli::Stages::Play

Inherits:
Base show all
Defined in:
lib/petli/stages/play.rb

Constant Summary

Constants inherited from Base

Base::GAME_HEIGHT, Base::GAME_WIDTH

Instance Attribute Summary

Attributes inherited from Tatty::Stage

#framerate

Instance Method Summary collapse

Methods inherited from Base

#action_bar, #action_pages, #draw, #initialize, #keypress, #left, #top

Methods inherited from Tatty::Stage

#draw, #goto, #initialize, #keypress, #leave, #move_to, #render, #render_at, #render_box, #screen_height, #screen_size, #screen_width, #step

Constructor Details

This class inherits a constructor from Petli::Stages::Base

Instance Method Details

#actionsObject



4
5
6
# File 'lib/petli/stages/play.rb', line 4

def actions
  %w(guess dice)
end

#onkey(event) ⇒ Object



8
9
10
11
12
# File 'lib/petli/stages/play.rb', line 8

def onkey(event)
  return goto(Dice, pet: @pet) if event.value == "d"
  return goto(Guess, pet: @pet) if event.value == "g"
  goto(Main, pet: @pet)
end