-[NEW] Retras aleatori per a les gotes

-[FIX] Arreglada representació gràfica de les gotes en l'editor
This commit is contained in:
2026-03-23 11:51:56 +01:00
parent 53aea81265
commit abb3e5e048
5 changed files with 9 additions and 14 deletions

View File

@@ -1,21 +1,16 @@
function ia.update_gota(spr)
if spr.timer > 0 then
spr.invisible = true
spr.timer = spr.timer-1
if spr.timer == 1 then
spr.animation_finished = nil
spr.current_frame = 1
spr.current_wait = 1
end
return
else
spr.invisible = nil;
if spr.animation_finished then
if spr.current_frame==2 then
local gota = templates.create("gota_caiguent", {pos={x=spr.pos.x, y=spr.pos.y}, flipped=spr.flipped})
table.insert(sprites.list, gota)
spr.animation_finished = nil
spr.current_frame = 1
spr.current_wait = 1
--spr.animation_finished = nil
--spr.current_frame = 1
--spr.current_wait = 1
end
end
end