Save tokens on movemebnt checks
I promise this is mathematically equivalent-ish to the original. (0.2 and its multiples are nonterminating decimals in base 2, so there's a little jank when the negative shift right is a shift left.)
This commit is contained in:
parent
9d93f30426
commit
1995501583
@ -544,12 +544,12 @@ function level:can_move(
|
|||||||
if player.rope then
|
if player.rope then
|
||||||
local chk=false
|
local chk=false
|
||||||
local w,h=1.6,0.2
|
local w,h=1.6,0.2
|
||||||
if (dmx==0) w,h=0.2,1.6
|
if dmx==0 then
|
||||||
|
w,h=0.2,1.6
|
||||||
if (dmy==-1) rectx,recty=0.4,-0.8
|
else
|
||||||
if (dmy==1) rectx,recty=0.4,0.2
|
dmy = 0
|
||||||
if (dmx==-1) rectx,recty=-0.8,0.4
|
end
|
||||||
if (dmx==1) rectx,recty=0.2,0.4
|
rectx,recty=dmx*(0.4>>>dmx),dmy*(0.4>>>dmy)
|
||||||
|
|
||||||
if (player.rope:collide_mrect(mx0+rectx,my0+recty,w,h,exclude_src,exclude_dst)) return false
|
if (player.rope:collide_mrect(mx0+rectx,my0+recty,w,h,exclude_src,exclude_dst)) return false
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user