set romsize 2k player0: %00010000 %00010000 %00010000 %10111010 %10111010 %11111110 %11111110 %10010010 end player1: %10010010 %11111110 %11111110 %10111010 %10111010 %00010000 %00010000 %00010000 end game_reset player0y = 9 player0x = 150 player1y = 87 player1x = 6 ballheight = 8 ballx = 78 bally = 47 a = (rand&127) if a < 64 then x = 1 else x = -1 y = 0 missile0height = 4 missile0y = 8 missile1y = 84 missile1height = 4 player0score = $00 player1score = $00 game_loop if switchreset then goto game_reset CTRLPF = $31 COLUP0 = $4A COLUP1 = $8A COLUPF = $1E COLUBK = $00 player0scorecolor = $4A player1scorecolor = $8A if joy0left && player0x > 2 then player0x = player0x - 2 if joy0right && player0x < 154 then player0x = player0x + 2 if joy1left && player1x > 2 then player1x = player1x - 2 if joy1right && player1x < 154 then player1x = player1x + 2 if missile0y > 86 then missile0y = 8 if missile1y < 7 then missile1y = 84 if missile1y = 84 then missile1x = player1x + 4 if missile0y = 8 then missile0x = player0x + 4 if missile0y > 8 then missile0y = missile0y + 2 if missile1y < 84 then missile1y = missile1y - 2 AUDC0 = 12 : AUDF0 = missile0y - 10 if missile0y > 9 && missile0y < 41 then AUDV0 = 8 else AUDV0 = 0 AUDC1 = 4 : AUDF1 = 82 - missile1y if missile1y < 83 && missile1y > 51 then AUDV1 = 8 else AUDV1 = 0 if joy0fire && missile0y = 8 then missile0y = 10 if joy1fire && missile1y = 84 then missile1y = 82 bally = bally + y if y <> 0 then ballx = ballx + x if bally < 10 then y = 1 : player1score = addbcd(player1score, 1) if bally > 85 then y = -1 : player0score = addbcd(player0score, 1) if ballx < 3 then x = 1 if ballx > 153 then x = -1 if player0score > $09 || player1score > $09 then goto game_over drawscreen if collision(missile0,ball) then y = 1 : x = -x : missile0y = 8 if collision(missile1,ball) then y = -1 : x = -x : missile1y = 84 goto game_loop game_over if player0score > player1score then COLUP0 = $36 if player1score > player0score then COLUP1 = $86 drawscreen if !switchreset then goto game_over goto game_reset inline playerscores.asm inline bcd_math.asm