Advertisement
matrefeytontias

[Axe]Jumps lib (Ti-Editor compatible)

Mar 3rd, 2012
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. :...
  2. :Jumps lib
  3. :GDB1J is used, X and Y are the X-Pos and Y-Pos of your sprite
  4. :2nd is used to jump
  5. :The perso will not jump if there are pixels above him
  6. :And he will fall if there aren't pixels under him
  7. :Just put it in your code !
  8. :By Matrefeytontias
  9. :...
  10. :
  11. :If {GDB1J}=0 and {GDB1J+4} and getKey(54)
  12. : 1→{GDB1J}→{GDB1J+2}→{GDB1J+4}*8→{GDB1J+1
  13. : Y→{GDB1J+3
  14. :End
  15. :
  16. :If {GDB1J}
  17. : {GDB1J+1}-{GDB1J+2}→{GDB1J+1}
  18. : 0→r<sub>2</sub>
  19. : For(r<sub>1</sub>,min(Y,‾int(GDB1J+1}//2+Y→r<sub>6</sub>),max(Y,r<sub>6</sub>))
  20. : Pxl-Test(X+4,r<sub>1</sub>) or r<sub>2</sub>??0→r<sub>2</sub>,1→r<sub>2</sub>
  21. : End
  22. :
  23. : r<sub>2</sub>??r<sub>6</sub>→Y
  24. :
  25. : {GDB1J+3}≤Y?0→{GDB1J
  26. :End
  27. :
  28. :For(r<sub>1</sub>,0,7)
  29. : For(r<sub>2</sub>,0,4)
  30. : 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
  31. : End
  32. :End
  33. :
  34. :0→{GDB1J+4
  35. :
  36. :For(r<sub>1</sub>,0,7)
  37. : For(r<sub>2</sub>,0,4)
  38. : !If Pxl-Test(X+r<sub>1</sub>,Y+7+r<sub>2</sub>) or {GDB1J} or {GDB1J+4}
  39. : →{GDB1J+4
  40. : Else!If {GDB1J} or {GDB1J+4}
  41. : 1→{GDB1J+4
  42. : End
  43. : End
  44. :End
  45. :
  46. :{GDB1J} or {GDB1J+4}??Y+4→Y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement