-[NEW] Retras aleatori per a les gotes
-[FIX] Arreglada representació gràfica de les gotes en l'editor
This commit is contained in:
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 |
@@ -206,16 +206,16 @@ animations = {
|
|||||||
},
|
},
|
||||||
["gota_generador"] = {
|
["gota_generador"] = {
|
||||||
cycle = {1,2,3,4,5,6,7,8},
|
cycle = {1,2,3,4,5,6,7,8},
|
||||||
loop = false,
|
loop = true,
|
||||||
frames = {
|
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=0,y=0,w=8,h=8}, wait=2 },
|
||||||
{ frame={x=8,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=16,y=0,w=8,h=8}, wait=2 },
|
||||||
{ frame={x=24,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=32,y=0,w=8,h=8}, wait=2 },
|
||||||
{ frame={x=40,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"] = {
|
["gota"] = {
|
||||||
|
|||||||
@@ -1,21 +1,16 @@
|
|||||||
|
|
||||||
function ia.update_gota(spr)
|
function ia.update_gota(spr)
|
||||||
if spr.timer > 0 then
|
if spr.timer > 0 then
|
||||||
spr.invisible = true
|
|
||||||
spr.timer = spr.timer-1
|
spr.timer = spr.timer-1
|
||||||
if spr.timer == 1 then
|
return
|
||||||
spr.animation_finished = nil
|
|
||||||
spr.current_frame = 1
|
|
||||||
spr.current_wait = 1
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
spr.invisible = nil;
|
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})
|
local gota = templates.create("gota_caiguent", {pos={x=spr.pos.x, y=spr.pos.y}, flipped=spr.flipped})
|
||||||
table.insert(sprites.list, gota)
|
table.insert(sprites.list, gota)
|
||||||
spr.animation_finished = nil
|
--spr.animation_finished = nil
|
||||||
spr.current_frame = 1
|
--spr.current_frame = 1
|
||||||
spr.current_wait = 1
|
--spr.current_wait = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -205,7 +205,7 @@ function me.create(type, options)
|
|||||||
animation = "gota_generador",
|
animation = "gota_generador",
|
||||||
state = me.ALIVE,
|
state = me.ALIVE,
|
||||||
enemy = true,
|
enemy = true,
|
||||||
timer = 0,
|
timer = math.random(0,100),
|
||||||
room = options.room,
|
room = options.room,
|
||||||
ia = ia.update_gota
|
ia = ia.update_gota
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user