Advertisement
Guest User

Untitled

a guest
May 3rd, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. Variables used:
  2.  
  3. G_pw = argument0;
  4. sp_v = 0;
  5. sp_v_round = 0;
  6. sp_h = 0;
  7. sp_h_round = 0;
  8. sp_h_max = 0
  9. still = true
  10.  
  11. code:
  12.  
  13. if place_free(x,y+1) {
  14. sp_v = sp_v + G_pw;
  15. }
  16. else {
  17. if sp_v > 0 {
  18. sp_v = 0
  19. }
  20. }
  21. if not place_free(x,y-1) and sp_v<0 {
  22. sp_v=0
  23. }
  24.  
  25. sp_v_round = round(sp_v);
  26.  
  27. if sp_v_round != 0 {
  28. if sp_v_round > 0 {
  29. for (i = sp_v_round; i>0; i-=1) {
  30. if place_free(x,y+i) {
  31. y+=i
  32. i=0
  33. }
  34. }
  35. }
  36. else {
  37. for (i = sp_v_round; i<0; i+=1) {
  38. if place_free(x,y+i) {
  39. y+=i
  40. i=0
  41. }
  42. }
  43. }
  44. }
  45. if still {
  46. sp_h_max = 0
  47. }
  48.  
  49. if sp_h > sp_h_max or sp_h < sp_h_max * -1 {
  50. if sp_h !=0 {
  51. if sp_h>0 {
  52. if place_free(x,y+1) {
  53. if sp_h > 0.5 {
  54. sp_h-=0.5
  55. }
  56. else {
  57. sp_h=0
  58. }
  59. }
  60. else {
  61. if sp_h > 1 {
  62. sp_h-=1
  63. }
  64. else {
  65. sp_h=0
  66. }
  67. }
  68. }
  69. else {
  70. if place_free(x,y+1) {
  71. if sp_h < -0.5 {
  72. sp_h+=0.5
  73. }
  74. else {
  75. sp_h=0
  76. }
  77. }
  78. else
  79. if sp_h < -1 {
  80. sp_h+=1
  81. }
  82. else {
  83. sp_h=1
  84. }
  85. }
  86. }
  87. }
  88.  
  89. sp_h_round = round(sp_h)
  90.  
  91. if sp_h_round != 0 {
  92. if sp_h_round > 0 {
  93. for (i = sp_h_round; i>0; i-=1) {
  94. if place_free(x+i,y) {
  95. x+=i
  96. i=0
  97. }
  98. }
  99. }
  100. else {
  101. for (i = sp_h_round; i<0; i+=1) {
  102. if place_free(x+i,y) {
  103. x+=i
  104. i=0
  105. }
  106. }
  107. }
  108. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement