local shine_step = 1 local shine_wait = 0 local shine_pos = 0 function collision(a, b) return (a.x+a.bb.x+a.bb.w >= b.x+b.bb.x) and (a.x+a.bb.x <= b.x+b.bb.x+b.bb.w) and (a.y+a.bb.y+a.bb.h >= b.y+b.bb.y) and (a.y+a.bb.y <= b.y+b.bb.y+b.bb.h) end function remove_actor(actor) for index, value in pairs(actors) do if value == actor then table.remove(actors,index) end end end 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