Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.24 KB | None | 0 0
  1. var chars : array char of boolean
  2. var chars2 : array char of boolean
  3. var ld : string
  4. var pms : string
  5. var mc : int
  6. var s : int
  7. var x : int %pacmans x
  8. var y : int %pacmans y
  9. var rx : int %red pacmans x
  10. var ry : int %red pacmans y
  11. var dx1 : int
  12. var dy1 : int
  13. var sd : int
  14. var radx1 : int
  15. var radx2 : int
  16. var rady1 : int
  17. var rady2 : int
  18. var rradx1 : int
  19. var rradx2 : int
  20. var rrady1 : int
  21. var rrady2 : int
  22. rx := 125
  23. ry := 75
  24. sd := 1
  25. s := 10 %pacmans speed
  26. x := 500 %pacmans starting x position
  27. y := 75 %pacmans starting y position
  28. mc := 9
  29. radx1 := x + 15
  30. radx2 := x - 15
  31. rady1 := y + 15
  32. rady2 := y - 15
  33. rradx1 := rx + 15
  34. rradx2 := rx - 15
  35. rrady1 := ry + 15
  36. rrady2 := ry - 15
  37. setscreen ("graphics:1000;500") %size of the run screen
  38. colorback (7)
  39. cls
  40. loop
  41. Draw.ThickLine (100, 50, 900, 50, 10, mc)
  42. Draw.ThickLine (100, 50, 100, 450, 10, mc)
  43. Draw.ThickLine (100, 450, 900, 450, 10, mc)
  44. Draw.ThickLine (900, 450, 900, 50, 10, mc)
  45. drawbox (600, 350, 850, 400, mc)
  46. drawbox (150, 350, 450, 400, mc)
  47. drawbox (500, 400, 550, 200, mc)
  48. drawbox (150, 300, 400, 250, mc)
  49. drawbox (650, 250, 850, 300, mc)
  50. drawbox (150, 100, 850, 150, mc)
  51. Input.KeyDown (chars)
  52. Input.KeyDown (chars2)
  53. if chars (KEY_UP_ARROW) then
  54. y := y + 1
  55. x := x
  56. ld := "u"
  57. radx1 := x + 15
  58. radx2 := x - 15
  59. rady1 := y + 15
  60. rady2 := y - 15
  61. drawfilloval (x, y, 15, 15, 43)
  62. drawfillarc (x, y, 15, 15, 70, 120, 7)
  63. delay (s)
  64. elsif chars (KEY_DOWN_ARROW) then
  65. y := y - 1
  66. x := x
  67. ld := "d"
  68. radx1 := x + 15
  69. radx2 := x - 15
  70. rady1 := y + 15
  71. rady2 := y - 15
  72. drawfilloval (x, y, 15, 15, 43)
  73. drawfillarc (x, y, 15, 15, 230, 310, 7)
  74. delay (s)
  75. elsif chars (KEY_LEFT_ARROW) then
  76. y := y
  77. x := x - 1
  78. ld := "l"
  79. radx1 := x + 15
  80. radx2 := x - 15
  81. rady1 := y + 15
  82. rady2 := y - 15
  83. drawfilloval (x, y, 15, 15, 43)
  84. drawfillarc (x, y, 15, 15, 130, 210, 7)
  85. delay (s)
  86. elsif chars (KEY_RIGHT_ARROW) then
  87. y := y
  88. x := x + 1
  89. ld := "r"
  90. radx1 := x + 15
  91. radx2 := x - 15
  92. rady1 := y + 15
  93. rady2 := y - 15
  94. drawfilloval (x, y, 15, 15, 43)
  95. drawfillarc (x, y, 15, 15, 310, 40, 7)
  96. delay (s)
  97. else
  98. drawfilloval (x, y, 15, 15, 43)
  99. delay (s)
  100. end if
  101. drawfilloval (x, y, 15, 15, black)
  102. if x = 0 then
  103. x := 1000
  104. elsif x = 1000 then
  105. x := 0
  106. elsif y = 0 then
  107. y := 500
  108. elsif y = 500 then
  109. y := 0
  110. end if
  111.  
  112. if chars ('0') then
  113. colour (white)
  114. put "BOOST ENABLED"
  115. s := 5
  116. else
  117. s := 10
  118. end if
  119. if y < 72 then
  120. y := y + 1
  121. elsif x < 122 then
  122. x := x + 1
  123. elsif y > 425 then
  124. y := y - 1
  125. elsif x > 874 then
  126. x := x - 1
  127. elsif x < 870 and x > 580 and y = 330 then
  128. y := y - 1
  129. elsif x = 580 and y < 420 and y > 330 then
  130. x := x - 1
  131. elsif x = 870 and y < 420 and y > 330 then
  132. x := x + 1
  133. elsif x < 870 and x > 580 and y = 422 then
  134. y := y + 1
  135. elsif x < 470 and x > 130 and y = 330 then
  136. y := y - 1
  137. elsif x = 130 and y < 420 and y > 330 then
  138. x := x - 1
  139. elsif x = 470 and y < 420 and y > 330 then
  140. x := x + 1
  141. elsif x > 130 and x < 470 and y = 420 then
  142. y := y + 1
  143. elsif x > 130 and x < 870 and y = 170 then
  144. y := y + 1
  145. elsif x > 130 and x < 870 and y = 80 then
  146. y := y - 1
  147. elsif x = 130 and y < 170 and y > 80 then
  148. x := x - 1
  149. elsif x = 870 and y < 170 and y > 80 then
  150. x := x + 1
  151. elsif x = 570 and y < 420 and y > 180 then
  152. x := x + 1
  153. elsif x = 480 and y < 420 and y > 180 then
  154. x := x - 1
  155. elsif y = 420 and x > 480 and x < 570 then
  156. y := y + 1
  157. elsif y = 180 and x > 480 and x < 570 then
  158. y := y - 1
  159. elsif y = 320 and x < 420 and x > 130 then
  160. y := y + 1
  161. end if
  162. if y = 230 and x < 420 and x > 130 then
  163. y := y - 1
  164. elsif x = 130 and y < 320 and y > 230 then
  165. x := x - 1
  166. elsif x = 420 and y < 320 and y > 230 then
  167. x := x + 1
  168. elsif y = 320 and x > 630 and x < 870 then
  169. y := y + 1
  170. elsif y = 230 and x > 630 and x < 870 then
  171. y := y - 1
  172. elsif x = 630 and y > 230 and y < 320 then
  173. x := x - 1
  174. elsif x = 870 and y > 230 and y < 320 then
  175. x := x + 1
  176. end if
  177.  
  178. if ry < 72 then
  179. ry := ry + 1
  180. elsif rx < 122 then
  181. rx := rx + 1
  182. elsif ry > 425 then
  183. ry := ry - 1
  184. elsif rx > 874 then
  185. rx := rx - 1
  186. elsif rx < 870 and rx > 580 and ry = 330 then
  187. ry := ry - 1
  188. elsif rx = 580 and ry < 420 and ry > 330 then
  189. rx := rx - 1
  190. elsif rx = 870 and ry < 420 and ry > 330 then
  191. rx := rx + 1
  192. elsif rx < 870 and rx > 580 and ry = 422 then
  193. ry := ry + 1
  194. elsif rx < 470 and rx > 130 and ry = 330 then
  195. ry := ry - 1
  196. elsif rx = 130 and ry < 420 and ry > 330 then
  197. rx := rx - 1
  198. elsif rx = 470 and ry < 420 and ry > 330 then
  199. rx := rx + 1
  200. elsif rx > 130 and rx < 470 and ry = 420 then
  201. ry := ry + 1
  202. elsif rx > 130 and rx < 870 and ry = 170 then
  203. ry := ry + 1
  204. elsif rx > 130 and rx < 870 and ry = 80 then
  205. ry := ry - 1
  206. elsif rx = 130 and ry < 170 and ry > 80 then
  207. rx := rx - 1
  208. elsif rx = 870 and ry < 170 and ry > 80 then
  209. rx := rx + 1
  210. elsif rx = 570 and ry < 420 and ry > 180 then
  211. rx := rx + 1
  212. elsif rx = 480 and ry < 420 and ry > 180 then
  213. rx := rx - 1
  214. elsif ry = 420 and rx > 480 and rx < 570 then
  215. ry := ry + 1
  216. elsif ry = 180 and rx > 480 and rx < 570 then
  217. ry := ry - 1
  218. elsif ry = 320 and rx < 420 and rx > 130 then
  219. ry := ry + 1
  220. elsif ry = 230 and rx < 420 and rx > 130 then
  221. ry := ry - 1
  222. elsif rx = 130 and ry < 320 and ry > 230 then
  223. rx := rx - 1
  224. elsif rx = 420 and ry < 320 and ry > 230 then
  225. rx := rx + 1
  226. elsif ry = 320 and rx > 630 and rx < 870 then
  227. ry := ry + 1
  228. elsif ry = 230 and rx > 630 and rx < 870 then
  229. ry := ry - 1
  230. elsif rx = 630 and ry > 230 and ry < 320 then
  231. rx := rx - 1
  232. elsif rx = 870 and ry > 230 and ry < 320 then
  233. rx := rx + 1
  234. end if
  235.  
  236.  
  237. if chars2 ('w') then
  238. ry := ry + 1
  239. rx := rx
  240. ld := "u"
  241. rradx1 := rx + 15
  242. rradx2 := rx - 15
  243. rrady1 := ry + 15
  244. rrady2 := ry - 15
  245. drawfilloval (rx, ry, 15, 15, 12)
  246. drawfillarc (rx, ry, 15, 15, 70, 120, 7)
  247. delay (s)
  248. elsif chars2 ('s') then
  249. ry := ry - 1
  250. rx := rx
  251. ld := "d"
  252. rradx1 := rx + 15
  253. rradx2 := rx - 15
  254. rrady1 := ry + 15
  255. rrady2 := ry - 15
  256. drawfilloval (rx, ry, 15, 15, 12)
  257. drawfillarc (rx, ry, 15, 15, 230, 310, 7)
  258.  
  259.  
  260.  
  261.  
  262. delay (s)
  263. elsif chars2 ('a') then
  264. ry := ry
  265. rx := rx - 1
  266. ld := "l"
  267. rradx1 := rx + 15
  268. rradx2 := rx - 15
  269. rrady1 := ry + 15
  270. rrady2 := ry - 15
  271. drawfilloval (rx, ry, 15, 15, 12)
  272. drawfillarc (rx, ry, 15, 15, 130, 210, 7)
  273. delay (s)
  274. elsif chars2 ('d') then
  275. ry := ry
  276. rx := rx + 1
  277. ld := "r"
  278. rradx1 := rx + 15
  279. rradx2 := rx - 15
  280. rrady1 := ry + 15
  281. rrady2 := ry - 15
  282. drawfilloval (rx, ry, 15, 15, 12)
  283. drawfillarc (rx, ry, 15, 15, 310, 40, 7)
  284. delay (s)
  285. else
  286. drawfilloval (rx, ry, 15, 15, 12)
  287. delay (s)
  288. end if
  289.  
  290. if whatdotcolour (rx + 15, ry + 2) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 or
  291. whatdotcolour (rx + 15, ry + 15) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 or
  292. whatdotcolour (rx + 15, ry + 15) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 or
  293. whatdotcolour (rx + 15, ry + 15) = 43 or whatdotcolour (rx + 15, ry + 15) = 43 then
  294. exit
  295.  
  296. end if
  297. cls
  298. end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement