rem Generated 6/2/2021 4:59:50 PM by Visual bB Version 1.0.0.568 rem ********************************** rem * * rem * * rem * * rem * * rem * * rem ********************************** set kernel_options no_blank_lines title_loop set kernel_options pfcolors pfcolors: $44 $88 $42 $88 $42 $88 $44 $86 $42 $96 $44 end playfield: X..XX.......XX..XX...XXXX.XXX..X X..X.X.....X.X.X..X.....X.X....X X..X..X...X..X.XXXX....X..XXX..X X..X...X.X...X.X..X...X...X....X X..X....X....X.X..X..XXXX.XXX..X X..............................X X..XXXX.X..XX..XXX..XXXXX.XXXX.X X.X.....X.X...X...X.....X.X....X X.X.....XX....XXXXX...XX..XXXX.X X.X.....X.....X...X..X....X....X X..XXXX.X.....X...X.XXXXX.XXXX.X end if joy0fire then goto main_loop drawscreen goto title_loop main_loop set kernel_options pfcolors pfcolors: $36 $36 $0E $36 $36 $0E $36 $36 $0E $36 $36 end playfield: XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXX........................XXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end player0x=50:player0y=50 player1x=20:player1y=20 missile0height=4:missile0y=255 NUSIZ0 = 16 sprites player0color: $42 $42 $42 $42 $42 $42 $42 $42 end player0: %00111100 %01111110 %11000011 %10111101 %11111111 %11111111 %01011010 %00111100 end COLUP0 = $4A player1color: $1C $1C $1C $1C $1C $1C $1C $1C end player1: %01011010 %01111110 %00011000 %01011010 %10111101 %01011010 %10011001 %00000000 end COLUP1 = $1E if missile0y>240 then goto skip missile0y = missile0y-2:goto main_loop skip if joy0fire then missile0y = player0y-2:missile0x=player0x+4 if joy0fire then AUDV0 = 10 : AUDC0 = 8 : AUDF0 = 4 if missile0y>player0y then AUDV0 = 0 draw_loop drawscreen if player1y < player0y then player1y = player1y+1 if player1y> player0y then player1y = player1y-1 if player1x< player0x then player1x = player1x+1 if player1x> player0x then player1x = player1x-1 player1x = player1x:player1y = player1y if joy0up then player0y = player0y-1: goto jump if joy0down then player0y = player0y+1: goto jump if joy0left then player0x = player0x-1: goto jump if joy0right then player0x = player0x +1: goto jump if collision(player0,player1)then goto gameover_loop goto point:player1x=rand/2:player1y=0:missile0y=255 points score=score+1 point score=score-1 jump goto sprites drawscreen goto main_loop gameover_loop set kernel_options pfcolors pfcolors: $0E $36 $36 $36 $36 $8A $36 $36 $36 $36 $0E end playfield: ...XXXX...XXX...X.......X.XXXX.. ..X......X...X..XX.....XX.X..... ..X.XXXX.XXXXX..X.X...X.X.XXXX.. ..X....X.X...X..X..X.X..X.X..... ...XXXXX.X...X..X...X...X.XXXX.. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX .XXX...X.......X.XXXX..XXXXX.... X...X...X.....X..X.....X....X... X...X....X...X...XXXX..XXXXX.... X...X.....X.X....X.....X....X... .XXX.......X.....XXXX..X....X... end rem ***************************************************** rem * rem * Music Starter using sdata rem * rem * Based on code posted in the Ballblazer thread at AtariAge: rem * http://www.atariage.com/forums/index.php?s=&showtopic=130990&view=findpost&p=1615280 rem * rem * Code adapted by Duane Alan Hahn (Random Terrain) rem * rem * Explanation: rem * The 256-byte limitation is removed when using sdata. rem * You can fill a whole 4k bank with music if you want. rem * rem ***************************************************** set smartbranching on rem ***************************************************** rem * Create aliases for variables rem ***************************************************** dim duration=a dim rand16=z rem ***************************************************** rem * Variable descriptions rem ***************************************************** rem * duration - how long each note plays rem * x - used for sdata rem * y - used for sdata rem * rand16 - makes better random numbers rem * Volume off AUDV0=0 AUDV1=0 rem * Initialize duration and set up music duration = 1 goto MusicSetup rem ***************************************************** rem * rem * Main game loop starts here. rem * rem ***************************************************** MainLoop goto GetMusic GotMusic drawscreen goto MainLoop 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,8,14 0,0,0 6 0,0,0 0,0,0 11 8,8,13 0,0,0 6 0,0,0 0,0,0 6 8,8,12 0,0,0 6 0,0,0 0,0,0 6 0,0,0 0,0,0 6 8,12,7 0,0,0 78 2,12,7 0,0,0 8 0,0,0 0,0,0 6 8,12,8 0,0,0 72 2,12,8 0,0,0 8 0,0,0 0,0,0 6 8,12,9 0,0,0 15 2,12,9 0,0,0 8 0,0,0 0,0,0 6 8,12,9 0,0,0 95 2,12,9 0,0,0 8 255 end goto GotMusic drawscreen goto gameover_loop