Added actual images and prepared to add extractors

This commit is contained in:
2026-06-16 21:58:05 -06:00
parent 46d45783f3
commit 564c600150
16 changed files with 121 additions and 20 deletions
+26
View File
@@ -0,0 +1,26 @@
# Nathan Hinton
#
# When placed it will extract numbers at a specified rate and place them on any
# conveyer belts that are adjacent to it.
class Extractor
def initialize(x, y, box_size)
@x = x
@y = y
@box_size = box_size
@image = Gosu.render(@box_size - (2 * BORDER), @box_size - (2 * BORDER)) {
Gosu::Image.new('assets/images/producer.png').draw(0, 0, 0, @box_size / 32.0, @box_size / 32.0)
Gosu::Image.from_text("#{@number}", 20, font: FONT_PATH).draw(10 / 32.0 * @box_size, (8 / 32.0 * @box_size), 1, 2, 2, 0xFFFA32C0)
}
end
def update(delta_mult, camera_x, camera_y)
@draw_x = (((((@screen_width / @box_size.to_f) / 2.0) + (@x - camera_x) * camera_zoom) * @box_size) + BORDER * camera_zoom)
@draw_y = (((((@screen_height / @box_size.to_f) / 2.0) + (@y - camera_y) * camera_zoom) * @box_size) + BORDER * camera_zoom)
@camera_zoom = camera_zoom
end
def draw()
@image.draw(@draw_x, @draw_y, 0, @camera_zoom, @camera_zoom)
end
end