Skip to content

Instantly share code, notes, and snippets.

@SergioFLS
Last active April 20, 2018 02:03
Show Gist options
  • Save SergioFLS/93b86ecce1221c8df25bede036919f25 to your computer and use it in GitHub Desktop.
Save SergioFLS/93b86ecce1221c8df25bede036919f25 to your computer and use it in GitHub Desktop.
part from cart.lua
-- tile 3 is an tree, tile 256 is the character
-- NOTE: Update() is executed trough function TIC()
function Update()
if btnp(0,30,3) then
if mget(x+14,y+7) == 2 then
sfx(1)
else
y=y-1
sfx(0)
end
elseif btnp(1,30,3) then
if mget(x+14,y+-1) == 2 then
sfx(1)
else
y=y+1
sfx(0)
end
elseif btnp(2,30,3) then
if mget(x+13,y+8) == 2 then
sfx(1)
else
x=x-1
sfx(0)
end
elseif btnp(3,30,3) then
if mget(x+15,y+8) == 2 then
sfx(1)
else
x=x+1
sfx(0)
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment