Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- rem Compiler options
- set smartbranching on
- set kernel_options pfcolors no_blank_lines
- rem Declare constants
- const true = 1
- const false = 0
- const left_direction = 0
- const right_direction = 1
- const pfscore = 1
- rem Declare variables
- dim duration=e
- dim rand16=z
- dim facing_left = a
- dim shooting = b
- dim poop_sound = c
- dim splash_sound = d
- dim tub_speed = e
- dim sub_speed = i
- dim tub_direction = f
- dim random_number = g
- dim hiscore0 = h
- dim hiscore1 = j
- dim scr0 = score
- dim scr1 = score + 1
- rem hiscore0 = 0 : hiscore1 = 0
- scorecolor = $C4
- soft_reset
- pfcolors:
- $1E
- $3E
- $3C
- $3A
- $38
- $1E
- $2E
- $2C
- $2A
- $28
- $1E
- end
- playfield:
- ................................
- .XXX..XX..X..X.XX..X.X.XXX.X..X.
- .X..X.X.X.X..X.X.X.XX..X...XX.X.
- .X..X.XX..X..X.X.X.X.X.XX..X.XX.
- .XXXX.X.X..XX..X.X.X.X.XXX.X..X.
- ................................
- ...XXX...XX...XX..XXX..XXX.XX...
- ...X..X.X..X.X..X.X..X.X...X.X..
- ...XXX..X..X.X..X.XXX..XX..XX...
- ...X.....XX...XX..X....XXX.X.X..
- ................................
- end
- scr0 = hiscore0 : scr1 = hiscore1
- if hiscore0 || hiscore1 then scorecolor = $40
- rem * Volume off
- AUDV0=0
- AUDV1=0
- rem * Initialize duration and set up music
- duration = 1
- goto MusicSetup
- draw_title
- goto GetMusic
- GotMusic
- COLUP0 = 0
- COLUP1 = 0
- drawscreen
- if joy0fire then goto main
- goto draw_title
- main
- rem * Volume off
- AUDV0=0
- AUDV1=0
- for x = 1 to 32: drawscreen : next
- rem Initialize variables
- score = 0
- scorecolor = 30
- COLUPF = 40
- missile1x=255
- missile1y=0
- missile1height=4
- shooting = false
- pfscorecolor = 98
- pfscore1=21
- sub_speed = 1
- tub_speed = 1
- tub_direction = left_direction
- random_number = rand
- x = 0 : y = 0
- pfcolors:
- $90
- $90
- $90
- $0E
- $0C
- $0E
- $0C
- $0E
- $0C
- $0E
- $0C
- end
- playfield:
- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
- XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
- ................................
- .XXX.XXX.XXX.XXX.XXX.XXX.XXX.XXX
- ................................
- XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
- ................................
- .XXX.XXX.XXX.XXX.XXX.XXX.XXX.XXX
- ................................
- XX.XXX.XXX.XXX.XXX.XXX.XXX.XXX.X
- end
- player0x = 80: player0y = 10
- player1x = 80: player1y = 88
- player0:
- %11111000
- %10011100
- %00011100
- %01111100
- %00001100
- %00011000
- %00101100
- %00011100
- end
- player1:
- %10000001
- %01111110
- %11111111
- %11111111
- %10000001
- %00000000
- %00000000
- %00000000
- end
- draw_loop
- COLUP0 = 110
- COLUP1 = 254
- NUSIZ1 = $15
- REFP0 = facing_left
- random_number = rand
- if random_number = 255 then gosub change_tub
- if joy0left then gosub move_left
- if joy0right then gosub move_right
- if joy0fire && shooting = false then gosub start_shooting
- gosub move_tub
- if shooting = true then gosub move_poop
- if splash_sound > 0 then gosub play_splash_sound
- if missile1y > 140 then gosub stop_shooting
- if collision( missile1, player1) then gosub direct_hit
- if !pfscore1 then die
- drawscreen
- if player0x < 1 then player0x = 1
- if player0x > 152 then player0x = 152
- goto draw_loop
- die
- if scr0 > hiscore0 then new_hi
- if scr0 < hiscore0 then keep_hi
- if scr1 > hiscore1 then new_hi
- if scr1 <= hiscore1 then keep_hi
- new_hi
- hiscore0 = scr0 : hiscore1 = scr1
- keep_hi
- player0x = 0 : player0y = 0
- player1x = 0 : player1y = 0
- goto soft_reset
- move_left
- player0x = player0x - 1
- facing_left = 0
- return
- move_right
- player0x = player0x + 1
- facing_left = 8
- return
- stop_shooting
- missile1y = 0
- missile1x = 255
- shooting = false
- gosub stop_sound_one
- pfscore1 = pfscore1 / 4
- return
- start_shooting
- missile1y = 10
- missile1x = player0x + 4
- shooting = true
- poop_sound = 100
- return
- direct_hit
- score = score + 100
- splash_sound = 80
- gosub stop_shooting
- pfscore1=21
- sub_speed = sub_speed + 1
- if sub_speed = 4 then gosub change_speed
- gosub change_tub
- return
- play_poop_sound
- AUDV0 = 8
- AUDC0 = 14
- AUDF0 = 12
- return
- move_tub
- if tub_direction = right_direction then player1x = player1x + tub_speed
- if tub_direction = left_direction then player1x = player1x - tub_speed
- if player1x < 8 then player1x = 144 else if player1x > 144 then player1x = 8
- return
- stop_sound_one
- AUDV0 = 0
- AUDC0 = 0
- AUDF0 = 0
- return
- play_splash_sound
- splash_sound = splash_sound - 1
- AUDV1 = 5
- AUDC1 = 8
- AUDF1 = 14
- if splash_sound = 0 then gosub stop_sound_two
- return
- stop_sound_two
- AUDV1 = 0
- AUDC1 = 0
- AUDF1 = 0
- return
- change_tub
- if tub_direction = right_direction then tub_direction = left_direction else tub_direction = right_direction
- return
- move_poop
- missile1y = missile1y + 2
- gosub play_poop_sound
- return
- change_speed
- tub_speed = tub_speed + 1
- sub_speed = 1
- return
- rem *****************************************************
- rem * Music
- rem *****************************************************
- GetMusic
- rem * Check for end of current note
- duration = duration - 1
- if duration>0 then GotMusic
- rem * Retrieve channel 0 data
- temp4 = sread(musicData)
- temp5 = sread(musicData)
- temp6 = sread(musicData)
- rem * Check for end of data
- if temp4=255 then duration = 1 : goto MusicSetup
- rem * Play channel 0
- AUDV0 = temp4
- AUDC0 = temp5
- AUDF0 = temp6
- rem * Retrieve channel 1 data
- temp4 = sread(musicData)
- temp5 = sread(musicData)
- temp6 = sread(musicData)
- rem * Play channel 1
- AUDV1 = temp4
- AUDC1 = temp5
- AUDF1 = temp6
- rem * Set duration
- duration = sread(musicData)
- goto GotMusic
- rem *****************************************************
- rem * Music Data Block
- rem *****************************************************
- rem * Format:
- rem * v,c,f (channel 0)
- rem * v,c,f (channel 1)
- rem * d
- rem *
- rem * Explanation:
- rem * v - volume (0 to 15)
- rem * c - control [a.k.a. tone, voice, and distortion] (0 to 15)
- rem * f - frequency (0 to 31)
- rem * d - duration
- MusicSetup
- sdata musicData=x
- 8,12,31
- 0,0,0
- 15
- 8,12,23
- 0,0,0
- 15
- 8,12,19
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,17
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,26
- 0,0,0
- 15
- 8,12,20
- 0,0,0
- 15
- 8,12,17
- 0,0,0
- 15
- 8,12,19
- 0,0,0
- 15
- 8,12,17
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,23
- 0,0,0
- 15
- 8,12,19
- 0,0,0
- 15
- 8,12,14
- 0,0,0
- 15
- 8,12,14
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,29
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,26
- 0,0,0
- 15
- 8,12,29
- 0,0,0
- 15
- 8,12,23
- 0,0,0
- 15
- 8,12,26
- 0,0,0
- 15
- 8,12,20
- 0,0,0
- 15
- 8,12,19
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,14
- 0,0,0
- 15
- 8,12,14
- 0,0,0
- 15
- 8,12,29
- 0,0,0
- 15
- 8,12,29
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 8,12,31
- 0,0,0
- 15
- 8,12,26
- 0,0,0
- 15
- 8,12,29
- 0,0,0
- 15
- 8,12,23
- 0,0,0
- 15
- 8,12,26
- 0,0,0
- 15
- 8,12,23
- 0,0,0
- 15
- 8,12,26
- 0,0,0
- 15
- 8,12,23
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 8,12,14
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 8,12,14
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,19
- 0,0,0
- 15
- 8,12,17
- 0,0,0
- 15
- 8,12,15
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 8,12,11
- 0,0,0
- 15
- 255,255,255
- 255,255,255
- 1
- end
- goto GotMusic
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement