Skip to content

Instantly share code, notes, and snippets.

@Achie72
Created October 7, 2022 21:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Achie72/7e905ae1e2b44a2e608732b0dab3f233 to your computer and use it in GitHub Desktop.
Save Achie72/7e905ae1e2b44a2e608732b0dab3f233 to your computer and use it in GitHub Desktop.
TIC-80 Player Movement
-- variable to save if the player is moving
-- in a direction sideways, for us to make
-- the ship lean in said way
leaning = 0
if btn(0) then
y=y-speed
end
if btn(1) then
y=y+speed
end
if btn(2) then
x=x-speed
leaning = -1
end
if btn(3) then
x=x+speed
leaning = 1
end
if btn(5) and (nextShoot < t) then
--shooting code
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment