Advertisement
Guest User

dpooper_messed_with.bas

a guest
Apr 30th, 2013
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.82 KB | None | 0 0
  1. rem Compiler options
  2.  
  3. set smartbranching on
  4. set kernel_options pfcolors no_blank_lines
  5.  
  6. rem Declare constants
  7.  
  8. const true = 1
  9. const false = 0
  10. const left_direction = 0
  11. const right_direction = 1
  12. const pfscore = 1
  13.  
  14. rem Declare variables
  15.  
  16. dim duration=e
  17. dim rand16=z
  18. dim facing_left = a
  19. dim shooting = b
  20. dim poop_sound = c
  21. dim splash_sound = d
  22. dim tub_speed = e
  23. dim sub_speed = i
  24. dim tub_direction = f
  25. dim random_number = g
  26. dim hiscore0 = h
  27. dim hiscore1 = j
  28. dim scr0 = score
  29. dim scr1 = score + 1
  30.  
  31. rem hiscore0 = 0 : hiscore1 = 0
  32. scorecolor = $C4
  33.  
  34. soft_reset
  35.  
  36. pfcolors:
  37. $1E
  38. $3E
  39. $3C
  40. $3A
  41. $38
  42. $1E
  43. $2E
  44. $2C
  45. $2A
  46. $28
  47. $1E
  48. end
  49. playfield:
  50. ................................
  51. .XXX..XX..X..X.XX..X.X.XXX.X..X.
  52. .X..X.X.X.X..X.X.X.XX..X...XX.X.
  53. .X..X.XX..X..X.X.X.X.X.XX..X.XX.
  54. .XXXX.X.X..XX..X.X.X.X.XXX.X..X.
  55. ................................
  56. ...XXX...XX...XX..XXX..XXX.XX...
  57. ...X..X.X..X.X..X.X..X.X...X.X..
  58. ...XXX..X..X.X..X.XXX..XX..XX...
  59. ...X.....XX...XX..X....XXX.X.X..
  60. ................................
  61. end
  62.  
  63. scr0 = hiscore0 : scr1 = hiscore1
  64. if hiscore0 || hiscore1 then scorecolor = $40
  65.  
  66. rem * Volume off
  67. AUDV0=0
  68. AUDV1=0
  69.  
  70. rem * Initialize duration and set up music
  71. duration = 1
  72. goto MusicSetup
  73.  
  74. draw_title
  75.  
  76. goto GetMusic
  77. GotMusic
  78. COLUP0 = 0
  79. COLUP1 = 0
  80. drawscreen
  81. if joy0fire then goto main
  82. goto draw_title
  83.  
  84. main
  85.  
  86. rem * Volume off
  87. AUDV0=0
  88. AUDV1=0
  89.  
  90. for x = 1 to 32: drawscreen : next
  91.  
  92.  
  93.  
  94. rem Initialize variables
  95.  
  96. score = 0
  97. scorecolor = 30
  98. COLUPF = 40
  99. missile1x=255
  100. missile1y=0
  101. missile1height=4
  102. shooting = false
  103. pfscorecolor = 98
  104. pfscore1=21
  105. sub_speed = 1
  106. tub_speed = 1
  107. tub_direction = left_direction
  108. random_number = rand
  109. x = 0 : y = 0
  110.  
  111.  
  112.  
  113. pfcolors:
  114. $90
  115. $90
  116. $90
  117. $0E
  118. $0C
  119. $0E
  120. $0C
  121. $0E
  122. $0C
  123. $0E
  124. $0C
  125. end
  126. playfield:
  127. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  128. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  129. XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
  130. ................................
  131. .XXX.XXX.XXX.XXX.XXX.XXX.XXX.XXX
  132. ................................
  133. XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
  134. ................................
  135. .XXX.XXX.XXX.XXX.XXX.XXX.XXX.XXX
  136. ................................
  137. XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
  138. end
  139.  
  140.  
  141.  
  142.  
  143. player0x = 80: player0y = 10
  144. player1x = 80: player1y = 88
  145.  
  146.  
  147. player0:
  148. %11111000
  149. %10011100
  150. %00011100
  151. %01111100
  152. %00001100
  153. %00011000
  154. %00101100
  155. %00011100
  156. end
  157.  
  158. player1:
  159. %10000001
  160. %01111110
  161. %11111111
  162. %11111111
  163. %10000001
  164. %00000000
  165. %00000000
  166. %00000000
  167. end
  168.  
  169.  
  170. draw_loop
  171.  
  172. COLUP0 = 110
  173. COLUP1 = 254
  174. NUSIZ1 = $15
  175. REFP0 = facing_left
  176. random_number = rand
  177. if random_number = 255 then gosub change_tub
  178. if joy0left then gosub move_left
  179. if joy0right then gosub move_right
  180. if joy0fire && shooting = false then gosub start_shooting
  181. gosub move_tub
  182. if shooting = true then gosub move_poop
  183. if splash_sound > 0 then gosub play_splash_sound
  184. if missile1y > 140 then gosub stop_shooting
  185. if collision( missile1, player1) then gosub direct_hit
  186. if !pfscore1 then die
  187. drawscreen
  188. if player0x < 1 then player0x = 1
  189. if player0x > 152 then player0x = 152
  190. goto draw_loop
  191.  
  192. die
  193. if scr0 > hiscore0 then new_hi
  194. if scr0 < hiscore0 then keep_hi
  195. if scr1 > hiscore1 then new_hi
  196. if scr1 <= hiscore1 then keep_hi
  197. new_hi
  198. hiscore0 = scr0 : hiscore1 = scr1
  199. keep_hi
  200. player0x = 0 : player0y = 0
  201. player1x = 0 : player1y = 0
  202. goto soft_reset
  203.  
  204. move_left
  205. player0x = player0x - 1
  206. facing_left = 0
  207. return
  208.  
  209. move_right
  210. player0x = player0x + 1
  211. facing_left = 8
  212. return
  213.  
  214. stop_shooting
  215. missile1y = 0
  216. missile1x = 255
  217. shooting = false
  218. gosub stop_sound_one
  219. pfscore1 = pfscore1 / 4
  220. return
  221.  
  222. start_shooting
  223. missile1y = 10
  224. missile1x = player0x + 4
  225. shooting = true
  226. poop_sound = 100
  227. return
  228.  
  229. direct_hit
  230. score = score + 100
  231.  
  232. splash_sound = 80
  233. gosub stop_shooting
  234. pfscore1=21
  235. sub_speed = sub_speed + 1
  236. if sub_speed = 4 then gosub change_speed
  237. gosub change_tub
  238. return
  239.  
  240. play_poop_sound
  241. AUDV0 = 8
  242. AUDC0 = 14
  243. AUDF0 = 12
  244. return
  245.  
  246. move_tub
  247. if tub_direction = right_direction then player1x = player1x + tub_speed
  248. if tub_direction = left_direction then player1x = player1x - tub_speed
  249. if player1x < 8 then player1x = 144 else if player1x > 144 then player1x = 8
  250. return
  251.  
  252. stop_sound_one
  253. AUDV0 = 0
  254. AUDC0 = 0
  255. AUDF0 = 0
  256. return
  257.  
  258. play_splash_sound
  259. splash_sound = splash_sound - 1
  260. AUDV1 = 5
  261. AUDC1 = 8
  262. AUDF1 = 14
  263. if splash_sound = 0 then gosub stop_sound_two
  264. return
  265.  
  266. stop_sound_two
  267. AUDV1 = 0
  268. AUDC1 = 0
  269. AUDF1 = 0
  270. return
  271.  
  272. change_tub
  273. if tub_direction = right_direction then tub_direction = left_direction else tub_direction = right_direction
  274. return
  275.  
  276. move_poop
  277. missile1y = missile1y + 2
  278. gosub play_poop_sound
  279. return
  280.  
  281. change_speed
  282. tub_speed = tub_speed + 1
  283. sub_speed = 1
  284. return
  285.  
  286.  
  287. rem *****************************************************
  288. rem * Music
  289. rem *****************************************************
  290. GetMusic
  291.  
  292. rem * Check for end of current note
  293. duration = duration - 1
  294. if duration>0 then GotMusic
  295.  
  296.  
  297. rem * Retrieve channel 0 data
  298. temp4 = sread(musicData)
  299. temp5 = sread(musicData)
  300. temp6 = sread(musicData)
  301.  
  302.  
  303. rem * Check for end of data
  304. if temp4=255 then duration = 1 : goto MusicSetup
  305.  
  306.  
  307. rem * Play channel 0
  308. AUDV0 = temp4
  309. AUDC0 = temp5
  310. AUDF0 = temp6
  311.  
  312.  
  313. rem * Retrieve channel 1 data
  314. temp4 = sread(musicData)
  315. temp5 = sread(musicData)
  316. temp6 = sread(musicData)
  317.  
  318.  
  319. rem * Play channel 1
  320. AUDV1 = temp4
  321. AUDC1 = temp5
  322. AUDF1 = temp6
  323.  
  324.  
  325. rem * Set duration
  326. duration = sread(musicData)
  327. goto GotMusic
  328.  
  329.  
  330.  
  331.  
  332. rem *****************************************************
  333. rem * Music Data Block
  334. rem *****************************************************
  335. rem * Format:
  336. rem * v,c,f (channel 0)
  337. rem * v,c,f (channel 1)
  338. rem * d
  339. rem *
  340. rem * Explanation:
  341. rem * v - volume (0 to 15)
  342. rem * c - control [a.k.a. tone, voice, and distortion] (0 to 15)
  343. rem * f - frequency (0 to 31)
  344. rem * d - duration
  345.  
  346. MusicSetup
  347. sdata musicData=x
  348.  
  349. 8,12,31
  350. 0,0,0
  351. 15
  352. 8,12,23
  353. 0,0,0
  354. 15
  355. 8,12,19
  356. 0,0,0
  357. 15
  358. 8,12,15
  359. 0,0,0
  360. 15
  361. 8,12,17
  362. 0,0,0
  363. 15
  364. 8,12,15
  365. 0,0,0
  366. 15
  367. 8,12,31
  368. 0,0,0
  369. 15
  370. 8,12,26
  371. 0,0,0
  372. 15
  373. 8,12,20
  374. 0,0,0
  375. 15
  376. 8,12,17
  377. 0,0,0
  378. 15
  379. 8,12,19
  380. 0,0,0
  381. 15
  382. 8,12,17
  383. 0,0,0
  384. 15
  385. 8,12,31
  386. 0,0,0
  387. 15
  388. 8,12,23
  389. 0,0,0
  390. 15
  391. 8,12,19
  392. 0,0,0
  393. 15
  394. 8,12,14
  395. 0,0,0
  396. 15
  397. 8,12,14
  398. 0,0,0
  399. 15
  400. 8,12,15
  401. 0,0,0
  402. 15
  403. 8,12,15
  404. 0,0,0
  405. 15
  406. 8,12,31
  407. 0,0,0
  408. 15
  409. 8,12,29
  410. 0,0,0
  411. 15
  412. 8,12,31
  413. 0,0,0
  414. 15
  415. 8,12,26
  416. 0,0,0
  417. 15
  418. 8,12,29
  419. 0,0,0
  420. 15
  421. 8,12,23
  422. 0,0,0
  423. 15
  424. 8,12,26
  425. 0,0,0
  426. 15
  427. 8,12,20
  428. 0,0,0
  429. 15
  430. 8,12,19
  431. 0,0,0
  432. 15
  433. 8,12,15
  434. 0,0,0
  435. 15
  436. 8,12,15
  437. 0,0,0
  438. 15
  439. 8,12,31
  440. 0,0,0
  441. 15
  442. 8,12,31
  443. 0,0,0
  444. 15
  445. 8,12,14
  446. 0,0,0
  447. 15
  448. 8,12,14
  449. 0,0,0
  450. 15
  451. 8,12,29
  452. 0,0,0
  453. 15
  454. 8,12,29
  455. 0,0,0
  456. 15
  457. 8,12,11
  458. 0,0,0
  459. 15
  460. 8,12,11
  461. 0,0,0
  462. 15
  463. 8,12,31
  464. 0,0,0
  465. 15
  466. 8,12,26
  467. 0,0,0
  468. 15
  469. 8,12,29
  470. 0,0,0
  471. 15
  472. 8,12,23
  473. 0,0,0
  474. 15
  475. 8,12,26
  476. 0,0,0
  477. 15
  478. 8,12,23
  479. 0,0,0
  480. 15
  481. 8,12,26
  482. 0,0,0
  483. 15
  484. 8,12,23
  485. 0,0,0
  486. 15
  487.  
  488. 8,12,11
  489. 0,0,0
  490. 15
  491. 8,12,14
  492. 0,0,0
  493. 15
  494. 8,12,11
  495. 0,0,0
  496. 15
  497. 8,12,15
  498. 0,0,0
  499. 15
  500. 8,12,11
  501. 0,0,0
  502. 15
  503. 8,12,14
  504. 0,0,0
  505. 15
  506. 8,12,15
  507. 0,0,0
  508. 15
  509. 8,12,19
  510. 0,0,0
  511. 15
  512. 8,12,17
  513. 0,0,0
  514. 15
  515. 8,12,15
  516. 0,0,0
  517. 15
  518. 8,12,11
  519. 0,0,0
  520. 15
  521. 8,12,11
  522. 0,0,0
  523. 15
  524.  
  525. 255,255,255
  526. 255,255,255
  527. 1
  528. end
  529. goto GotMusic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement