Finished allowing placement and collision detection. However, the placement is very inconsistent. Thinking about redoing coordinates again...

This commit is contained in:
2026-06-17 22:14:22 -06:00
parent 6f5ad9803f
commit e7825478f1
7 changed files with 161 additions and 36 deletions
+3 -2
View File
@@ -14,7 +14,7 @@ TASKS = [
]
class Consumer
attr_reader :draw_x, :draw_y
attr_reader :draw_x, :draw_y, :size_x, :size_y
# Create consumer at a position with the number and rate specified
# @param x [Integer] X position to start at
# @param y [Integer] Y position to start at
@@ -30,6 +30,7 @@ class Consumer
}
@task_index = 0
@tooltip = @parent.register_dialouge(@x, @y, @box_size * SIZE, @box_size * SIZE, TASKS[@task_index], 500)
@size_x = @size_y = 3
end
# Consumes numbers created
@@ -37,7 +38,7 @@ class Consumer
# @param camera_x [Integer] The camera X position
# @param camera_y [Integer] The camera Y position
# @param camera_zoom [Float] The camera zoom
def update(delta_mult, camera_x, camera_y, camera_zoom, mouse_x, mouse_y, mouse_used)
def update(delta_mult, camera_x, camera_y, camera_zoom, mouse_x, mouse_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