Fix collision detection.
This commit is contained in:
parent
98707059b6
commit
3985c3e301
|
@ -3,7 +3,7 @@ version 18
|
|||
__lua__
|
||||
#include mapgen.lua
|
||||
#include movement.lua
|
||||
#include infimap.lua
|
||||
#include main.lua
|
||||
__gfx__
|
||||
000000000000000033333333335555333344443338333333333333e3383333830000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000003333333335554553344444438a833383333e3e9e888338880000000000000000000000000000000000000000000000000000000000000000
|
||||
|
|
|
@ -27,7 +27,7 @@ end
|
|||
|
||||
|
||||
function handle_input()
|
||||
new_pos = camera_pos
|
||||
local new_pos = {camera_pos[1], camera_pos[2]}
|
||||
|
||||
if btnp(0) or btnp(1) or btnp(2) or btnp(3) then
|
||||
if btnp(0) then
|
||||
|
@ -70,5 +70,5 @@ end
|
|||
-- pos is camera position, meaning the player position is
|
||||
-- pos + {8, 8}.
|
||||
function legal_move(pos)
|
||||
return fget(mget(pos[1]+8, pos[2]+8), 0)
|
||||
return not fget(mget(pos[1]+8, pos[2]+8), 0)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user