Fix collision detection.
This commit is contained in:
parent
98707059b6
commit
3985c3e301
3 changed files with 3 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue