From e6959f05ec776d1cbb9e8aa7ba68dc55d9817271 Mon Sep 17 00:00:00 2001 From: Tyler Scott Date: Sat, 5 Feb 2022 07:53:04 +0700 Subject: [PATCH] Make slot x,y positions be absolute, not relative --- main.lua | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/main.lua b/main.lua index f616d04..942c174 100644 --- a/main.lua +++ b/main.lua @@ -106,6 +106,8 @@ function love.load(arg) game.bubble_type_counts = {} local bubble_types = {} for i = 1, #game.bubble_slots do + game.bubble_slots[i].x = game.bubble_slots[i].x + game.level_left + game.bubble_slots[i].y = game.bubble_slots[i].y + game.level_top local bubble_type = game.bubble_slots[i].bubble_type if game.bubble_type_counts[bubble_type] == nil then game.bubble_type_counts[bubble_type] = 0 @@ -148,21 +150,21 @@ function love.draw() for i = 1, #game.bubble_slots do local slot = game.bubble_slots[i] if slot.bubble_type >= 1 and slot.bubble_type <= #game.bubble_images then + love.graphics.setColor(1, 1, 1, 1) love.graphics.draw( - game.bubble_images[slot.bubble_type], -- image - game.level_x + slot.x, -- x - game.level_y + slot.y, -- y - 0, -- rotation - 1, -- x scale - 1, -- y scale - game.bubble_radius, -- x offset - game.bubble_radius -- y offset + game.bubble_images[slot.bubble_type], + slot.x, + slot.y, + 0, 1, 1, + game.bubble_radius, + game.bubble_radius ) else + love.graphics.setColor(0.4, 0, 0, 1) love.graphics.circle( 'line', - game.level_x + slot.x, - game.level_y + slot.y, + slot.x, + slot.y, game.bubble_radius ) end