- [FIX] La rata no pasaba per un hueco de 8 pixels de alt

- [FIX] Al tornar de l'editor, resetejar hero.invisible
- [NEW] Habitacions al 38%
This commit is contained in:
2026-03-24 13:36:20 +01:00
parent 50f2710986
commit cee6ade851
5 changed files with 3 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -267,6 +267,7 @@ end
function ia.hero_reset()
sprites.hero.state = templates.ALIVE
sprites.hero.invisible = nil
sprites.hero.lives = 4
sprites.hero.surf = surf.load("gfx/morcus.gif")
sprites.hero.animation = "hero_stand"

View File

@@ -13,14 +13,14 @@ function ia.update_rata(spr)
if spr.flipped then
local tx, ty = (spr.pos.x-1)>>3, (spr.pos.y+7)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
if map.tile(tx,ty) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x - 1
else
spr.flipped = not spr.flipped
end
else
local tx, ty = (spr.pos.x+9)>>3, (spr.pos.y+7)>>3
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
if map.tile(tx,ty) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x + 1
else
spr.flipped = not spr.flipped