- [FIX] arreglos en alguna habitació
- [NEW] particles quan la bala rebota
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 826 B After Width: | Height: | Size: 826 B |
Binary file not shown.
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
@@ -54,6 +54,13 @@ animations = {
|
||||
{ frame={x=156,y=0,w=4,h=3}, wait=4 }
|
||||
}
|
||||
},
|
||||
["particle"] = {
|
||||
cycle = {1},
|
||||
loop = false,
|
||||
frames = {
|
||||
{ frame={x=112,y=0,w=8,h=8}, wait=100 }
|
||||
}
|
||||
},
|
||||
["mummy_walk"] = {
|
||||
cycle = {1,2,1,3},
|
||||
loop = true,
|
||||
|
||||
@@ -11,7 +11,7 @@ function ia.update_bullet(spr)
|
||||
if util.check_aabb_collision(x1,y1,w1,h1, x2,y2,w2,h2) then
|
||||
if v.state == templates.ALIVE then
|
||||
if v.bulletproof then
|
||||
gota_esguita(spr)
|
||||
bullet_ricochet(spr)
|
||||
else
|
||||
v.state = templates.DYING
|
||||
end
|
||||
@@ -29,7 +29,15 @@ function ia.update_bullet(spr)
|
||||
spr.pos.x = spr.pos.x + 8
|
||||
end
|
||||
else
|
||||
sprites.remove(spr)
|
||||
bullet_ricochet(spr)
|
||||
--sprites.remove(spr)
|
||||
end
|
||||
end
|
||||
|
||||
function bullet_ricochet(spr)
|
||||
sprites.remove(spr)
|
||||
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x= 1,y= math.random(3,5)}, flipped=spr.flipped}))
|
||||
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x=-1,y= math.random(3,5)}, flipped=spr.flipped}))
|
||||
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x=-1,y=-math.random(3,5)}, flipped=spr.flipped}))
|
||||
table.insert(sprites.list, templates.create("bullet_particle", {pos={x=spr.pos.x, y=spr.pos.y}, dir={x= 1,y=-math.random(3,5)}, flipped=spr.flipped}))
|
||||
end
|
||||
|
||||
@@ -44,6 +44,23 @@ function me.create(type, options)
|
||||
animation = "bullet",
|
||||
ia = ia.update_bullet
|
||||
}
|
||||
elseif key == "bullet_particle" then
|
||||
sprite = {
|
||||
type = key,
|
||||
pos = options.pos,--{ x=100, y=4*12*8+71 },
|
||||
dir = options.dir,
|
||||
size = { w=8,h=8 },
|
||||
bbo = { left=2, top=3, right=3, bottom=1 },
|
||||
current_frame = 1,
|
||||
current_wait = 1,
|
||||
flipped = options.flipped,
|
||||
surf = surf.load("gfx/morcus.gif"),
|
||||
animation = "particle",
|
||||
state = me.ALIVE,
|
||||
enemy = true,
|
||||
room = options.room,
|
||||
ia = ia.update_gota_esguit
|
||||
}
|
||||
elseif key == "coin" then
|
||||
sprite = {
|
||||
type = key,
|
||||
|
||||
Reference in New Issue
Block a user