Skip to content

Instantly share code, notes, and snippets.

@KinoAR
Created March 28, 2019 01:22
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 KinoAR/d0595ef90a37a7686f4b0ab7633645d8 to your computer and use it in GitHub Desktop.
Save KinoAR/d0595ef90a37a7686f4b0ab7633645d8 to your computer and use it in GitHub Desktop.
An example double jump function written in the Pico-8 for implementing the mechanic.
function jump(p)
-- jump processing
if (btnp(2)
and p.jumpcount < 1) then
p.dy-=p.jumpforce
p.jumpcount+=1
sfx(0)
end
--resets count at floor level
if (p.y >= 119) then
p.jumpcount = 0
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment