rem Ultimate Indy 500 rem A 4 player race for paddles rem by Fort Apocalypse rem pointers and playfield from Michael ...Gruff rem TODO: rem * figure out how to limit the flickering rem * figure out how to get bB and Stella to emulate paddles set kernel_options no_blank_lines readpaddle set smartbranching on const playerscores = 4 const noscore = 1 rem bits 0-1 for p2, 2-3 p3, 3-4 p4, 5-6 p5, 7-8 unused dim damage=c rem bit 0, 1, 2, 3 for each player (spin reset when speed hits 0) dim spin=d dim p2dir=e dim p2x=f dim p2xdelta=g dim p2y=h dim p2ydelta=i dim p3dir=j dim p3x=k dim p3xdelta=l dim p3y=m dim p3ydelta=n dim p4dir=o dim p4x=p dim p4xdelta=q dim p4y=r dim p4ydelta=s dim p5dir=t dim p5x=u dim p5xdelta=v dim p5y=w dim p5ydelta=x gosub trackindy startgame AUDV0 = 0 AUDV1 = 0 player0score = $00 player1score = $00 player2score = $00 player3score = $00 player0scorecolor = 0 player1scorecolor = 222 player2scorecolor = 68 player3scorecolor = 52 mainloop rem *** read paddle 0 currentpaddle = 0 gosub spritegroupa drawscreen if paddle > 38 then p2x = p2x + 1 : if p2x > 145 then p2x = 1 if paddle < 38 then p2x = p2x - 1 : if p2x < 1 then p2x = 145 rem *** read paddle 1 currentpaddle = 1 gosub spritegroupb drawscreen if paddle > 38 then p3x = p3x + 1 : if p3x > 145 then p3x = 1 if paddle < 38 then p3x = p3x - 1 : if p3x < 1 then p3x = 145 rem *** read paddle 2 currentpaddle = 2 gosub spritegroupa drawscreen if paddle > 38 then p4x = p4x + 1 : if p4x > 145 then p4x = 1 if paddle < 38 then p4x = p4x - 1 : if p4x < 1 then p4x = 145 rem *** read paddle 3 currentpaddle = 3 gosub spritegroupb drawscreen if paddle > 38 then p5x = p5x + 1 : if p5x > 145 then p5x = 1 if paddle < 38 then p5x = p5x - 1 : if p5x < 1 then p5x = 145 rem example for lap count if p2x = 75 then player0score = addbcd(player0score, 1) : rem Adds 1 to player0score if p3x = 75 then player1score = addbcd(player1score, 1) : rem Adds 1 to player1score if p4x = 75 then player2score = addbcd(player2score, 1) : rem Adds 1 to player2score if p5x = 75 then player3score = addbcd(player3score, 1) : rem Adds 1 to player3score if player0score > $09 then goto gameover if player1score > $09 then goto gameover if player2score > $09 then goto gameover if player3score > $09 then goto gameover goto mainloop gameover rem TODO need to change all colors gosub spritegroupa drawscreen gosub spritegroupb drawscreen goto gameover spritegroupa player0x=p2x player0y=p2y COLUP0 = 0 gosub p0r270 player1x=p3x player1y=p3y COLUP1 = 222 gosub p1r270 rem flagpole NUSIZ1 = $00 missile1height = 6 missile1x = missile1x - 1 missile1y = missile1y + 4 return spritegroupb player0x = p4x player0y = p4y COLUP0 = 68 gosub p0r270 COLUP1 = 52 player1x = p5x player1y = p5y gosub p1r270 rem flag NUSIZ1 = $20 missile1height = 2 missile1y = missile1y - 4 missile1x = missile1x + 1 return p0r270 player0: %00000000 %00000000 %01100111 %11111111 %11111111 %01100111 %00000000 %00000000 end return p1r270 player1: %00000000 %00000000 %01100111 %11111111 %11111111 %01100111 %00000000 %00000000 end return p0r270l player0: %00000000 %00000000 %01100111 %11111111 %11111111 %01100111 %00000000 %00000000 end return p0r305 player0: %00000110 %00001111 %00011111 %00011110 %01111100 %11110000 %11110000 %01100000 end p0r0 return player0: %00111100 %00111100 %00111100 %00011000 %00011000 %00111100 %00111100 %00011000 end return player0: %01100000 %11110000 %11111000 %01111000 %00111110 %00001111 %00001111 %00000110 end return player0: %00000000 %00000000 %11100110 %11111111 %11111111 %11100110 %00000000 %00000000 end return player0: %00000110 %00001111 %00001111 %00111110 %01111000 %11111000 %11110000 %01100000 end return player0: %00011000 %00111100 %00111100 %00011000 %00011000 %00111100 %00111100 %00111100 end return player0: %01100000 %11110000 %11110000 %01111100 %00011110 %00011111 %00001111 %00000110 end return trackindy COLUPF = 128 : COLUBK=6 missile1x = 80 : missile1y = 55 rem Player initial positions (behind starting line) p2x = 80 : p2y = 85 p3x = 90 : p3y = 80 p4x = 100 : p4y = 75 p5x = 110 : p5y = 70 playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X..............................X 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 pfscroll upup : pfscroll upup return rem should be last lines in game inline playerscores.asm inline bcd_math.asm