mend
Updated consumer with text
This commit is contained in:
+1
-2
@@ -8,6 +8,7 @@ BORDER = 2
|
||||
SIZE = 3
|
||||
HOVER_TIME = 500 # ms
|
||||
|
||||
# This actually should be stored somewhere else. This is the goals/quests for the game
|
||||
TASKS = [
|
||||
"Collect 10 1's"
|
||||
]
|
||||
@@ -29,7 +30,6 @@ class Consumer
|
||||
@task_index = 0
|
||||
@tooltip_timer = 0
|
||||
@tooltip = DialougeBox.new(@x, @y, WIDTH, HEIGHT, TASKS[@task_index])
|
||||
puts 'made tooltip for consumer'
|
||||
end
|
||||
|
||||
# Consumes numbers created
|
||||
@@ -43,7 +43,6 @@ class Consumer
|
||||
@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)
|
||||
@tooltip_timer += 60.0 * delta_mult
|
||||
puts @tooltip_timer
|
||||
if @tooltip_timer > HOVER_TIME
|
||||
@tooltip.show = true
|
||||
@tooltip.update(@draw_x, @draw_y, @camera_zoom)
|
||||
|
||||
@@ -53,7 +53,6 @@ class DialougeBox
|
||||
|
||||
def draw()
|
||||
if @show
|
||||
puts "Drawing tooltip at #{@x}, #{@y}"
|
||||
@image.draw(@x, @y, 0, @camera_zoom, @camera_zoom)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -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)
|
||||
@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)
|
||||
puts 'mouse in consumer'
|
||||
@tooltip_timer += 60.0 * delta_mult
|
||||
if @tooltip_timer > HOVER_TIME
|
||||
@tooltip.show = true
|
||||
|
||||
Reference in New Issue
Block a user