Updated consumer with text
This commit is contained in:
2026-06-14 22:20:55 -06:00
parent 8bf6b14446
commit 96fa6d3c62
3 changed files with 1 additions and 4 deletions
+1 -2
View File
@@ -8,6 +8,7 @@ BORDER = 2
SIZE = 3 SIZE = 3
HOVER_TIME = 500 # ms HOVER_TIME = 500 # ms
# This actually should be stored somewhere else. This is the goals/quests for the game
TASKS = [ TASKS = [
"Collect 10 1's" "Collect 10 1's"
] ]
@@ -29,7 +30,6 @@ class Consumer
@task_index = 0 @task_index = 0
@tooltip_timer = 0 @tooltip_timer = 0
@tooltip = DialougeBox.new(@x, @y, WIDTH, HEIGHT, TASKS[@task_index]) @tooltip = DialougeBox.new(@x, @y, WIDTH, HEIGHT, TASKS[@task_index])
puts 'made tooltip for consumer'
end end
# Consumes numbers created # Consumes numbers created
@@ -43,7 +43,6 @@ class Consumer
@camera_zoom = camera_zoom @camera_zoom = camera_zoom
if 0 < mouse_x - @draw_x && mouse_x - @draw_x < (SIZE * @box_size * @camera_zoom) && 0 < mouse_y - @draw_y && mouse_y - @draw_y < (SIZE * @box_size * @camera_zoom) if 0 < mouse_x - @draw_x && mouse_x - @draw_x < (SIZE * @box_size * @camera_zoom) && 0 < mouse_y - @draw_y && mouse_y - @draw_y < (SIZE * @box_size * @camera_zoom)
@tooltip_timer += 60.0 * delta_mult @tooltip_timer += 60.0 * delta_mult
puts @tooltip_timer
if @tooltip_timer > HOVER_TIME if @tooltip_timer > HOVER_TIME
@tooltip.show = true @tooltip.show = true
@tooltip.update(@draw_x, @draw_y, @camera_zoom) @tooltip.update(@draw_x, @draw_y, @camera_zoom)
-1
View File
@@ -53,7 +53,6 @@ class DialougeBox
def draw() def draw()
if @show if @show
puts "Drawing tooltip at #{@x}, #{@y}"
@image.draw(@x, @y, 0, @camera_zoom, @camera_zoom) @image.draw(@x, @y, 0, @camera_zoom, @camera_zoom)
end end
end end
-1
View File
@@ -44,7 +44,6 @@ class Producer
@draw_y = (((((@screen_height / @box_size.to_f) / 2.0) + (@y - camera_y) * 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 @camera_zoom = camera_zoom
if 0 < mouse_x - @draw_x && mouse_x - @draw_x < (@box_size * @camera_zoom) && 0 < mouse_y - @draw_y && mouse_y - @draw_y < (@box_size * @camera_zoom) if 0 < mouse_x - @draw_x && mouse_x - @draw_x < (@box_size * @camera_zoom) && 0 < mouse_y - @draw_y && mouse_y - @draw_y < (@box_size * @camera_zoom)
puts 'mouse in consumer'
@tooltip_timer += 60.0 * delta_mult @tooltip_timer += 60.0 * delta_mult
if @tooltip_timer > HOVER_TIME if @tooltip_timer > HOVER_TIME
@tooltip.show = true @tooltip.show = true