Created
March 28, 2019 01:22
-
-
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.
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
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