added background
This commit is contained in:
@@ -93,6 +93,15 @@ class NumFactory < Gosu::Window
|
||||
end
|
||||
end # End file loading
|
||||
|
||||
@background = Gosu.render(@game_width, @game_height) {
|
||||
im = Gosu::Image.new('assets/images/background_square.png', {:tileable => true})
|
||||
(@game_width / 30).to_i.times do |ww|
|
||||
(@game_height / 30).to_i.times do |hh|
|
||||
im.draw(ww * 30, hh * 30)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
@tick_time = Time.now()
|
||||
@delta_time = 0
|
||||
|
||||
@@ -183,6 +192,7 @@ class NumFactory < Gosu::Window
|
||||
[self.width, (@camera_max_x - @camera_x) * @camera_zoom].min,
|
||||
[self.height, (@camera_max_y - @camera_y) * @camera_zoom].min,
|
||||
@background_color, 0)
|
||||
@background.draw(0, 0, 0, @camera_zoom, @camera_zoom)
|
||||
@producers.each do |producer|
|
||||
if producer.x <= @camera_max_x && producer.x >= @camera_min_x
|
||||
if producer.y <= @camera_max_y && producer.y >= @camera_min_y
|
||||
|
||||
Reference in New Issue
Block a user