rem Easter rem by Fort Apocalypse rem includes must happen before anything else include div_mul16.asm set smartbranching off set kernel_options no_blank_lines dim shakescreen = a dim p0cl = b dim p0x = c dim p0y = d dim p1cl = e dim p1x = f dim p1y = g dim playerdirbits = h dim level = l dim gamebits = p dim p0yaccel = m dim p1yaccel = n rem s is sound dim timer = t dim somex = q dim somey = r init const pfscore=1 pfscorecolor = 15 p0cl = 24 : p1cl = 68 gosub changegame selectgame gosub p0r : gosub p1l pfscore1 = 255 : pfscore2 = 255 player0x = 23 : player0y = 25 : COLUP0 = p0cl player1x = 131 : player1y = 25 : COLUP1 = p1cl : if !gamebits{5} then player1y = 140 : pfscore2 = 0 if joy0up then p0cl = p0cl + 1 if joy1up then p1cl = p1cl + 1 COLUPF = (level * 12) COLUBK = (level * 14) + 128 : scorecolor = (level * 18) + 128 if gamebits{0} && switchselect then gosub changegame : gamebits{0} = 0 if !switchselect then gamebits{0} = 1 if switchreset then goto startgame drawscreen goto selectgame changegame level = level + 1 if level > 8 then level = 1 : gamebits{5} = !gamebits{5} if level = 1 then gosub level1 if level = 2 then gosub level2 if level = 3 then gosub level3 if level = 4 then gosub level4 if level = 5 then gosub level5 if level = 6 then gosub level6 if level = 7 then gosub level7 if level = 8 then gosub level8 return startgame level = 1 p0x = 23 : p0y = 25 p1x = 131 : p1y = 25 pfscore1 = 255 : pfscore2 = 255 timer = 0 AUDV0 = 0 : AUDV1 = 0 playerdirbits = %00010000 mainloop COLUP0 = p0cl : COLUP1 = p1cl if switchreset then goto startgame if switchselect then goto init COLUPF = (level * 12) COLUBK = (level * 14) + 128 : scorecolor = (level * 18) + 128 rem *** must reset before every turn timer = timer + 1 if playerdirbits{0} then gosub p0l if playerdirbits{1} then gosub p0r rem if playerdirbits{2} then gosub p0 rem if playerdirbits{3} then gosub p0 if playerdirbits{4} then gosub p1l if playerdirbits{5} then gosub p1r if playerdirbits{6} then gosub p1 if playerdirbits{7} then gosub p1 if timer{0} then goto restofgame p0stuff if pfscore1 = 0 then p0y = 110 : goto p1stuff temp5 = 1 if joy0left then temp5 = 0 : p0x = p0x - 2 : playerdirbits = playerdirbits & %11110000 : playerdirbits{0} = 1 : gosub movep0 if joy0right then temp5 = 0 : p0x = p0x + 2 : playerdirbits = playerdirbits & %11110000 : playerdirbits{1} = 1 : gosub movep0 if joy0down && collision(playfield, player0) then temp5 = 0 : p0yaccel = 1 : playerdirbits = playerdirbits & %11110000 : playerdirbits{2} = 1 : gosub movep0 if joy0up && collision(playfield, player0) then temp5 = 0 : p0yaccel = 250 : playerdirbits = playerdirbits & %11110000 : playerdirbits{3} = 1 : gosub movep0 if temp5 = 1 then u=0 p0y = p0y + p0yaccel if p0x < 14 then p0x = 14 if p0x > 137 then p0x = 137 if p0y < 5 || p0y > 180 then p0y = 5 if p0y > 90 then p0y = 90 p1stuff if pfscore2 = 0 then p1y = 110 : goto restofgame if gamebits{5} then goto manualp1 if timer = 45 || p1x = somex then somex = p0x : somey = p0y if timer = 0 then somex = ( rand / 2 ) + 5 : somey = ( rand / 4 ) + 8 if p1y < somey && collision(playfield, player1) then p1yaccel = 1 : playerdirbits = playerdirbits & %00001111 : playerdirbits{6} = 1 : gosub movep1 if p1y > somey && collision(playfield, player1) then p1yaccel = 255 : playerdirbits = playerdirbits & %00001111 : playerdirbits{7} = 1 : gosub movep1 if p1x > somex then p1x = p1x - 2 : playerdirbits = playerdirbits & %00001111 : playerdirbits{4} = 1 : gosub movep1 if p1x < somex then p1x = p1x + 2 : playerdirbits = playerdirbits & %00001111 : playerdirbits{5} = 1 : gosub movep1 temp5 = p0y - 5 : temp6 = p0y + 5 if p1y < temp5 then goto afterp1 if p1y > temp6 then goto afterp1 if timer{3} then gosub firep1 goto afterp1 manualp1 if joy1left then p1x = p1x - 2 : playerdirbits = playerdirbits & %00001111 : playerdirbits{4} = 1 : gosub movep1 if joy1right then p1x = p1x + 2 : playerdirbits = playerdirbits & %00001111 : playerdirbits{5} = 1 : gosub movep1 if joy1down && collision(playfield, player1) then p1yaccel = 1 : playerdirbits = playerdirbits & %00001111 : playerdirbits{6} = 1 : gosub movep1 if joy1up && collision(playfield, player1) then p1yaccel = 255 : playerdirbits = playerdirbits & %00001111 : playerdirbits{7} = 1 : gosub movep1 if joy1fire && missile1y > 90 then gosub firep1 afterp1 p1y = p1y + p1yaccel if p1x < 14 then p1x = 145 if p1x > 137 then p1x = 137 if p1y < 5 || p1y > 180 then p1y = 5 if p1y > 90 then p1y = 90 restofgame if s > 0 then s = s - 1 : AUDV0 = s : AUDC0 = 4 : AUDF0 = s : AUDV1 = s : AUDC1 = 4 : AUDF1 = s if timer{3} then NUSIZ1 = $10 : missile1height = 4 : CTRLPF = $11 : ballheight = 4 else NUSIZ1 = $20 : missile1height = 2 : CTRLPF = $21 : ballheight = 2 CTRLPF = $61 : ballheight = 4 player0x = p0x : player0y = p0y : player1x = p1x : player1y = p1y drawscreen if pfscore1 = 0 && pfscore = 0 then goto gameover if timer{0} goto aftergravity if collision(playfield, player0) then p0yaccel = 0 else p0yaccel = p0yaccel + 1 if collision(playfield, player1) then p1yaccel = 0 else p1yaccel = p1yaccel + 1 aftergravity if collision(missile1, player0) then x = 140 : pfscore1 = pfscore1 / 2 : s = 15 if collision(ball, player1) then w = 140 : pfscore2 = pfscore2 / 2 : s = 15 y=y+1 : if y>4 then y=0 z=z+1 : if z>4 then z=0 if joy0fire && bally > 90 then gosub firep0 if gamebits{3} then ballx = ballx + 2 else ballx = ballx - 2 if ballx > 150 then w = 140 bally = w + y : NUSIZ0 = $30 if gamebits{4} then missile1x = missile1x + 4 else missile1x = missile1x - 4 if missile1x > 150 then x = 140 missile1y = x + z : NUSIZ1 = $30 goto mainloop firep0 if playerdirbits{2} then return if playerdirbits{3} then return ballx = p0x : w = p0y - 5 if playerdirbits{0} then gamebits{3} = 0 else gamebits{3} = 1 return firep1 if playerdirbits{6} then return if playerdirbits{7} then return missile1x = p1x : x = p1y - 5 if playerdirbits{4} then gamebits{4} = 0 else gamebits{4} = 1 return movep0 if timer{2} then gamebits{1} = !gamebits{1} return movep1 if timer{2} then gamebits{2} = !gamebits{2} return gameover timer = timer + 1 : if timer > 78 then timer = 64 COLUPF = timer : COLUBK = timer + 2 drawscreen if switchreset then goto startgame if switchselect then goto init goto gameover level1 playfield: X..X.XXXX.XXXX.XXXX.X..X........ X..X.X..X.X..X.X..X.X..X........ XXXX.XXXX.XXXX.XXXX.XXXX........ X..X.X..X.X....X.....XX........ X..X.X..X.X....X.....XX........ ................................ XXXX.XXXX.XXXX.XXXX.XXXX.XXX...X X....X..X.X.....XX..X....X..X..X XXX..XXXX.XXXX..XX..XXX..XXX...X X....X..X....X..XX..X....X..X... XXXX.X..X.XXXX..XX..XXXX.X..X..X end return level2 playfield: ................................ ................................ .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X ................................ .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X ................................ .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X ................................ .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X ................................ .X.X.X.X.X.X.X.X.X.X.X.X.X.X.X.X end return level3 playfield: ...............XXX.............. .............XX...XX............ ............X.......X........... ...........X.........X.......... ..........X.X.X.X.X.X.X......... ..........XX.X.X.X.X.XX......... ..........X.X.X.X.X.X.X......... ..........X..X.X.X.X..X......... ...........X.........X.......... ............X.......X........... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return level4 playfield: ................................ ................................ ................................ .............XXXXXXX............ ...........XX.......XX.......... ..........X...........X......... ..........XX.X.X.X.X.XX......... ...........XXXXXXXXXXX.......... ............X.X.X.X.X........... .............XXXXXXX............ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return level5 playfield: ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ..X..........................X.. X..............................X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ ................X............... ...X............X...........X... ................X............... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return level6 playfield: ........XXXXXXXX................ XXXX....XXXXXXXXXXXXXXXX........ ....XXXX........XXXX....XXXX.... XXXXXXXXXXXXXXXXXXXXXXXXXXXX.... XXXXXXXXXXXX....XXXXXXXX........ ....XXXXXXXXXXXX....XXXXXXXX.... ................................ ...X...X..............X...X..... ...X...X..............X...X..... ...X...X..............X...X..... XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return level7 playfield: ................................ .........X............X......... ........XXX..........XXX........ X.......XXXX........XXXX.......X X.......XXXXXXXXXXXXXXXX.......X X.......XXXXXXXXXXXXXXXX.......X X.......XXXXXXXXXXXXXXXX.......X X......XXXXXXXXXXXXXXXXXX......X X.....XXXXXXXXXXXXXXXXXXXX.....X X....XXXXXXXXXXXXXXXXXXXXXX....X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return level8 playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X..............................X X..............................X X......X.....XXXXXX.....X......X X......XX..............XX......X X......XXXXXXXXXXXXXXXXXX......X X......XXXXXXXXXXXXXXXXXX......X X..............................X X..............................X X..............................X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end return p0l if timer{0} then u=u+1 : if u>2 then u=0 if u=1 goto p0lb if u=2 goto p0lc goto p0la p0r if timer{0} then u=u+1 : if u>2 then u=0 if u=1 goto p0rb if u=2 goto p0rc goto p0ra p0la REFP0 = 8 p0ra if gamebits{1} then REFP0 = 8 player0: %01110110 %11101100 %11111110 %01001010 %10111100 %00110000 %00000000 %00000000 end return p0lb REFP0 = 8 p0rb player0: %01100000 %00111011 %00110110 %01011110 %00001110 %00100111 %00110101 %00011110 end return p0lc REFP0 = 8 p0rc player0: %00000111 %01011100 %11101111 %01111101 %00110110 %01001100 %00011000 %00000000 end return p1 if gamebits{2} then REFP1 = 8 player1: %00100000 %00100000 %00010000 %00010000 %00100000 %00100000 end return p1l if gamebits{2} then goto p1la else goto p1lb p1r if gamebits{2} then goto p1ra else goto p1rb p1la REFP1 = 8 p1ra player1: %11000011 %00111100 end return p1lb REFP1 = 8 p1rb player1: %00111100 %11000011 end return