-[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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -206,16 +206,16 @@ animations = {
},
["gota_generador"] = {
cycle = {1,2,3,4,5,6,7,8},
loop = false,
loop = true,
frames = {
{ frame={x=48,y=0,w=8,h=8}, wait=50 },
{ frame={x=48,y=0,w=8,h=8}, wait=1 },
{ frame={x=0,y=0,w=8,h=8}, wait=2 },
{ frame={x=8,y=0,w=8,h=8}, wait=2 },
{ frame={x=16,y=0,w=8,h=8}, wait=2 },
{ frame={x=24,y=0,w=8,h=8}, wait=2 },
{ frame={x=32,y=0,w=8,h=8}, wait=2 },
{ frame={x=40,y=0,w=8,h=8}, wait=2 },
{ frame={x=48,y=0,w=8,h=8}, wait=50 },
{ frame={x=48,y=0,w=8,h=8}, wait=1 }
}
},
["gota"] = {

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

View File

@@ -205,7 +205,7 @@ function me.create(type, options)
animation = "gota_generador",
state = me.ALIVE,
enemy = true,
timer = 0,
timer = math.random(0,100),
room = options.room,
ia = ia.update_gota
}