[gosuhunt] rubocop'd
This commit is contained in:
parent
801490298c
commit
a96a4097ba
1 changed files with 10 additions and 11 deletions
|
@ -9,7 +9,7 @@ class GosuHunt < Gosu::Window
|
|||
def initialize( number_of_mines = 20 )
|
||||
super 325, 180
|
||||
|
||||
self.caption = "Gosu Hunt"
|
||||
self.caption = 'Gosu Hunt'
|
||||
|
||||
@number_of_mines = number_of_mines
|
||||
@field = MineHunt::Board.new( @number_of_mines )
|
||||
|
@ -74,15 +74,15 @@ class GosuHunt < Gosu::Window
|
|||
def update; end
|
||||
|
||||
def draw
|
||||
if @state[:dead]
|
||||
self.caption = "You died! :(, score #{@field.score} "
|
||||
elsif @state[:victory]
|
||||
self.caption = "You won!! :), score #{@field.score} "
|
||||
else
|
||||
self.caption = "#{@field.number_of_mines} mines, #{@field.count_nearby_mines} nearby, score #{@field.score}"
|
||||
end
|
||||
self.caption = if @state[:dead]
|
||||
"You died! :(, score #{@field.score} "
|
||||
elsif @state[:victory]
|
||||
"You won!! :), score #{@field.score} "
|
||||
else
|
||||
"#{@field.number_of_mines} mines, #{@field.count_nearby_mines} nearby, score #{@field.score}"
|
||||
end
|
||||
|
||||
@font.draw_text( self.caption, 0, 0, 0 )
|
||||
@font.draw_text( caption, 0, 0, 0 )
|
||||
|
||||
@field.height.times do |y|
|
||||
@field.width.times do |x|
|
||||
|
@ -96,8 +96,7 @@ class GosuHunt < Gosu::Window
|
|||
@images[:mine]
|
||||
else
|
||||
@images[:cell]
|
||||
end )
|
||||
.draw( x * 2 * 10, (y * 20) + 20, 0 )
|
||||
end ).draw( x * 10, (y * 20) + 20, 0 )
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue