Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :...
- :Jumps lib
- :GDB1J is used, X and Y are the X-Pos and Y-Pos of your sprite
- :2nd is used to jump
- :The perso will not jump if there are pixels above him
- :And he will fall if there aren't pixels under him
- :Just put it in your code !
- :By Matrefeytontias
- :...
- :
- :If {GDB1J}=0 and {GDB1J+4} and getKey(54)
- : 1→{GDB1J}→{GDB1J+2}→{GDB1J+4}*8→{GDB1J+1
- : Y→{GDB1J+3
- :End
- :
- :If {GDB1J}
- : {GDB1J+1}-{GDB1J+2}→{GDB1J+1}
- : 0→r<sub>2</sub>
- : For(r<sub>1</sub>,min(Y,‾int(GDB1J+1}//2+Y→r<sub>6</sub>),max(Y,r<sub>6</sub>))
- : Pxl-Test(X+4,r<sub>1</sub>) or r<sub>2</sub>??0→r<sub>2</sub>,1→r<sub>2</sub>
- : End
- :
- : r<sub>2</sub>??r<sub>6</sub>→Y
- :
- : {GDB1J+3}≤Y?0→{GDB1J
- :End
- :
- :For(r<sub>1</sub>,0,7)
- : For(r<sub>2</sub>,0,4)
- : int(GDB1J+1}≤≤0 and Pxl-Test(X+r<sub>1</sub>,Y+7+r<sub>2</sub>)?0→{GDB1J}+1→{GDB1J+4}+Y+r<sub>2</sub>-2→Y
- : End
- :End
- :
- :0→{GDB1J+4
- :
- :For(r<sub>1</sub>,0,7)
- : For(r<sub>2</sub>,0,4)
- : !If Pxl-Test(X+r<sub>1</sub>,Y+7+r<sub>2</sub>) or {GDB1J} or {GDB1J+4}
- : →{GDB1J+4
- : Else!If {GDB1J} or {GDB1J+4}
- : 1→{GDB1J+4
- : End
- : End
- :End
- :
- :{GDB1J} or {GDB1J+4}??Y+4→Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement