- [NEW] Alguns ajustos en habitacions
- [FIX] Càlcul del tile més robust
This commit is contained in:
1 parent
af2c8fb68d
commit
7b63f963b0
17 files changed
+38
-32
No files matched your search
@@ -12,14 +12,14 @@ function ia.update_rata(spr)
|
||||
end
|
||||
|
||||
if spr.flipped then
|
||||
local tx, ty = (spr.pos.x-1)>>3, (spr.pos.y+7)>>3
|
||||
local tx, ty = sprites.get_tile(spr.pos.x-1), sprites.get_tile(spr.pos.y+7)
|
||||
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
|
||||
local tx, ty = sprites.get_tile(spr.pos.x+9), sprites.get_tile(spr.pos.y+7)
|
||||
if map.tile(tx,ty) < 16 and map.tile(tx,ty+1) > 0 then
|
||||
spr.pos.x = spr.pos.x + 1
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user