Class: Core::Game::Combat::Background

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

Instance Method Summary collapse

Constructor Details

#initialize(file, color = nil) ⇒ Background

Returns a new instance of Background.



83
84
85
86
87
88
89
90
# File 'lib/game/combat/battle.rb', line 83

def initialize(file, color=nil)
  @sprite = Core.sprite("backgrounds/#{file}")
  if !color
    @color = Gosu::Color::WHITE
  else
    @color = color
  end
end

Instance Method Details

#drawObject



93
94
95
# File 'lib/game/combat/battle.rb', line 93

def draw
  @sprite.draw(0, 0, 0, 1024/@sprite.width.to_f, 768/@sprite.height.to_f, @color)
end

#updateObject



91
92
# File 'lib/game/combat/battle.rb', line 91

def update
end