From 2564c54b3e7c6d376acd51a35750302da1f70c17 Mon Sep 17 00:00:00 2001 From: JailGamer Date: Fri, 3 Apr 2026 01:08:20 +0200 Subject: [PATCH] =?UTF-8?q?-=20[NEW]=20draw=5Fshiny=5Frect()=20-=20[WIP]?= =?UTF-8?q?=20Men=C3=BA=20d'opcions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/helpers.lua | 77 ++++++++++++++++++++++++++++++++++++++++++++++++ data/main.lua | 6 ++-- data/opcions.lua | 61 ++++++++++++++++++++++++++++++++++++++ data/title.lua | 6 +++- 4 files changed, 147 insertions(+), 3 deletions(-) create mode 100644 data/opcions.lua 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