Compare commits

...

2 Commits

Author SHA1 Message Date
c0dfd49360 Merge branch 'master' of https://gitea.sustancia.synology.me/JailDoctor/paku 2025-11-24 15:39:57 +01:00
ed4bcb3566 - [NEW] [editor] borrar items amb hover + SUPR
- [WIP] treball en habitacions
- [NEW] [tiles] punxos
- [FIX] Ajustada la trajectòria de la bala
2025-11-24 15:36:06 +01:00
6 changed files with 9 additions and 3 deletions

View File

@@ -169,6 +169,12 @@ editor = {
editor.modified = true editor.modified = true
end end
end end
if editor.item_hovered and key.press(key.DELETE) then
local sprite = sprites.list[editor.item_hovered]
map.surf(rooms.surf_items)
map.tile(sprite.pos.x//8,sprite.pos.y//8,0)
sprites.remove(sprite)
end
end end
end, end,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1004 B

After

Width:  |  Height:  |  Size: 1004 B

View File

@@ -159,7 +159,7 @@ sprites = {
end, end,
update_bullet = function(spr) 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 if rooms.is_outside(tx,ty) then sprites.remove(spr) return end
@@ -175,7 +175,7 @@ sprites = {
end end
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 if spr.flipped then
spr.pos.x = spr.pos.x - 8 spr.pos.x = spr.pos.x - 8
else else
@@ -296,7 +296,7 @@ sprites = {
elseif key.down(key.X) or pad.down(pad.B) then elseif key.down(key.X) or pad.down(pad.B) then
sprites.hero.shooting = true sprites.hero.shooting = true
local x = sprites.hero.flipped and sprites.hero.pos.x+8 or sprites.hero.pos.x-8 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) table.insert(sprites.list, bullet)
if sprites.hero.flipped then sprites.hero.pos.x=sprites.hero.pos.x-8 end if sprites.hero.flipped then sprites.hero.pos.x=sprites.hero.pos.x-8 end
anim = "hero_shoot" anim = "hero_shoot"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB