Last active
April 20, 2018 02:03
-
-
Save SergioFLS/93b86ecce1221c8df25bede036919f25 to your computer and use it in GitHub Desktop.
part from cart.lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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