Class: Diamante::Game

Inherits:
Object
  • Object
show all
Defined in:
lib/diamante/game.rb

Instance Method Summary collapse

Constructor Details

#initialize(configfile) ⇒ Game

Returns a new instance of Game.



11
12
13
14
# File 'lib/diamante/game.rb', line 11

def initialize(configfile)
  @term = ANSI.new
  @config = Config.new(configfile)
end

Instance Method Details

#game_loopObject



16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/diamante/game.rb', line 16

def game_loop
  begin
    init
    loop do
      process
      render
      sleep 0.1
    end
    deinit
  ensure
    ANSI.set_cooked_mode
  end
end