- [NEW] Alguns ajustos en habitacions

- [FIX] Càlcul del tile més robust
This commit is contained in:
Raimon @ quifisraimon committed 2026-09-30 12:58:48 +02:00
1 parent af2c8fb68d
commit 7b63f963b0
17 files changed
+38 -32

No files matched your search

+2 -2
View File
@@ -13,14 +13,14 @@ function ia.update_dimoni(spr)
end
if spr.flipped then
local tx, ty = (spr.pos.x+3)>>3, (spr.pos.y+15)>>3
local tx, ty = sprites.get_tile(spr.pos.x+3), sprites.get_tile(spr.pos.y+15)
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 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+12)>>3, (spr.pos.y+15)>>3
local tx, ty = sprites.get_tile(spr.pos.x+12), sprites.get_tile(spr.pos.y+15)
if map.tile(tx,ty) < 16 and map.tile(tx,ty-1) < 16 and map.tile(tx,ty+1) > 0 then
spr.pos.x = spr.pos.x + 1
else