diff --git a/data/helpers.lua b/data/helpers.lua index 6b60533..3d0db1e 100644 --- a/data/helpers.lua +++ b/data/helpers.lua @@ -1,3 +1,80 @@ +local shine_step = 1 +local shine_wait = 0 +local shine_pos = 0 + +function draw_shiny_rect(x, y, w, h, color, shine_color) + draw.rect(x,y,w,h,color) + + local shine_w= 18 + + -- Convertir el rectangle en una linea en checkpoints + local p0 = 0 + local p1 = p0+w-1 + local p2 = p1+h + local p3 = p2+w + local p4 = p3+h + + -- Punt inicial y final de la recta del brillo + local s0 = shine_step + local s1 = s0+shine_w + local y0 = 0 + + if s0==p4 then + shine_step=0 + draw.line(x, y, x+shine_w, y, shine_color) + elseif s0