Class: Falling::Interface
- Inherits:
-
Object
- Object
- Falling::Interface
- Defined in:
- lib/falling/interface.rb
Instance Attribute Summary collapse
-
#player ⇒ Object
readonly
Returns the value of attribute player.
Instance Method Summary collapse
-
#initialize(universe:, player: true) ⇒ Interface
constructor
A new instance of Interface.
- #run! ⇒ Object
Constructor Details
#initialize(universe:, player: true) ⇒ Interface
Returns a new instance of Interface.
9 10 11 12 13 |
# File 'lib/falling/interface.rb', line 9 def initialize(universe:, player: true) create_player! if player @universe = universe end |
Instance Attribute Details
#player ⇒ Object (readonly)
Returns the value of attribute player.
7 8 9 |
# File 'lib/falling/interface.rb', line 7 def player @player end |
Instance Method Details
#run! ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/falling/interface.rb', line 15 def run! with_screen do loop do map_view.refresh .refresh Curses.doupdate break unless .step! end end end |