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.



9
10
11
12
# File 'lib/diamante/game.rb', line 9

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

Instance Method Details

#game_loopObject



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

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