- [NEW] [editor] borrar items amb hover + SUPR

- [WIP] treball en habitacions
- [NEW] [tiles] punxos
- [FIX] Ajustada la trajectòria de la bala
This commit is contained in:
2025-11-24 15:36:06 +01:00
parent e366209f46
commit ed4bcb3566
6 changed files with 9 additions and 3 deletions

View File

@@ -159,7 +159,7 @@ sprites = {
end,
update_bullet = function(spr)
local tx, ty = (spr.pos.x+2)>>3, (spr.pos.y+1)>>3
local tx, ty, ty2 = (spr.pos.x+2)>>3, (spr.pos.y+1)>>3, (spr.pos.y+2)>>3
if rooms.is_outside(tx,ty) then sprites.remove(spr) return end
@@ -175,7 +175,7 @@ sprites = {
end
end
if map.tile(tx,ty) < 16 then
if map.tile(tx,ty) < 16 or map.tile(tx,ty2) < 16 then
if spr.flipped then
spr.pos.x = spr.pos.x - 8
else
@@ -296,7 +296,7 @@ sprites = {
elseif key.down(key.X) or pad.down(pad.B) then
sprites.hero.shooting = true
local x = sprites.hero.flipped and sprites.hero.pos.x+8 or sprites.hero.pos.x-8
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+8}, flipped=sprites.hero.flipped})
local bullet = templates.create("bullet", {pos={x=sprites.hero.pos.x, y=sprites.hero.pos.y+7}, flipped=sprites.hero.flipped})
table.insert(sprites.list, bullet)
if sprites.hero.flipped then sprites.hero.pos.x=sprites.hero.pos.x-8 end
anim = "hero_shoot"