- [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
@@ -15,14 +15,14 @@ function ia.update_berserk(spr)
|
||||
local advance = 1
|
||||
if sprites.hero.pos.y == spr.pos.y-1 then advance = 2 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 - advance
|
||||
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 + advance
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user