class Basher::UI::InfoView

Attributes

game[RW]

Public Class Methods

lines() click to toggle source
# File lib/basher/ui/info_view.rb, line 6
def self.lines
  1
end

Public Instance Methods

setup() click to toggle source
# File lib/basher/ui/info_view.rb, line 10
def setup
  clear
  window.attron(Ncurses::A_REVERSE)

  # Draw the bar first
  bar = Array.new(game.level.remaining.size, word_bar).join
  puts bar, h: :center

  # Add Level info above
  puts "| Level #{game.level.difficulty} |", h: :center

  window.attroff(Ncurses::A_REVERSE)
end

Private Instance Methods

word_bar() click to toggle source
# File lib/basher/ui/info_view.rb, line 26
def word_bar
  '-' * word_width
end
word_width() click to toggle source
# File lib/basher/ui/info_view.rb, line 30
def word_width
  size.columns / game.level.words.size
end