include div_mul.asm set kernel_options player1colors no_blank_lines set smartbranching on set romsize 8kSC set tv ntsc const pfscore = 1 rem paint pixel rem crash pixel dead_counter rem flags! verlusst dead const Flag = 0 const Metroid_EnergyTank = 1 data _Music0 0, 0, 13, 13, 15, 15, 15, 15, 18, 20, 23, 23, 23, 23, 23, 23, 17, 18, 17, 18, 17, 17, 27, 27, 27, 27, 31, 31, 31, 31, 0, 0, 0, 0, 13, 13, 15, 15, 15, 15, 11, 11, 23, 23, 18, 18, 18, 18, 20, 20, 24, 24, 31, 31, 31, 31, 23, 27, 0, 23, 27, 0, 23, 27, 0, 0, 20, 20, 20, 20, 24, 24, 0, 0, 27, 27, 27, 27, 31, 31, 31, 31, 31, 31, 0, 0, 0, 0, 0, 0, 0, 0 end data _Music1 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, 31, 31, 0, 0, 31, 0, 15, 0, 31, 31, 0, 0, 15, 15, 0, 0, 31, 31, 0, 0, end rem simple super car racing rem Level 1-31 rem Autorennen in der Stadt rem People cross the strett dim level_value = a dim player0_design = b dim player0_frame = c dim player1_design = d dim player1_frame = e dim playfield_design = f dim gameFrames = g dim mindex = h dim mdelaycounter = i dim bassfreq = j dim bassvol = k dim crash_counter = l dim dead_counter = m gosub _Control_Playfield_001_Setup gosub _Control_Scorebars_001_Setup gosub _level_image_loop gosub _Control_Player0_001_Setup player1_design = 0 playfield_design = 0 gosub _Control_Player1_004_Random_Position gameloop gosub _Control_GameFrames_Control gosub _Control_Player1_Moveing gosub _Control_Player1_Moveing_Checking gosub _Control_Music_Playing rem gosub _Control_Playfield_001_Setup gosub _Control_Playfield_002_Colors gosub _Control_Scorebars_002_Colors gosub _Control_Player0_Joystick gosub _Control_Player0_Painting gosub _Control_Player1_Painting gosub _Control_Collision drawscreen goto gameloop _Control_Player0_001_Setup player0x=70 : player0y = 86 return _Control_Collision if collision(player0,player1) && player0_design = 0 then gosub _Control_Player1_008_Point if collision(player0,player1) && player0_design = 1 then gosub _Control_Player1_008_Dead if collision(player0,playfield) then gosub _Control_Player1_008_Crash_Street return _Control_Player1_008_Crash_Street pfscore2 = pfscore2/2 gosub _Control_Player0_001_Setup crash_counter = crash_counter + 1 if crash_counter = 7 then pfscore2 = %11111111 : gosub _Control_Player1_032_Dead return _Control_Player1_032_Dead pfscore1 = pfscore1/2 dead_counter = dead_counter + 1 crash_counter = 0 if dead_counter = 2 then goto _Control_Player1_032_Game_Over return _Control_Player1_032_Game_Over dead_counter = 0 crash_counter = 0 pfclear playfield: .XXXXX.XXX....X.X.....XXX....... .X.....X.X...X.X.X....X......... .X..XX.XXX..X..X..X...XXX....... .X...X.X.X.X.......X..X......... .XXXXX.X.X.X.......X..XXX....... ................................ .XXXX.X...X.XXX.XX.............. .X..X.X...X.X...X.X............. .X..X..X.X..XXX.X.X............. .X..X..X.X..X...XX.............. .XXXX...X...XXX.X.X............. end game_game_over if joy0fire then goto _Control_002_GAMESTATUS____________________________________ROUTINES drawscreen goto game_game_over return _Control_Player1_008_Dead gosub _Control_Player1_004_Random_Position return _Control_Player1_008_Point gosub _Control_Player1_004_Random_Position score = score + 10 return _Control_Player1_Moveing player1y = player1y + 1 return _Control_Player1_Moveing_Checking rem wer schafft es return _Control_Player1_004_Random_Position temp5 = 50 temp6 = 25 player1x = temp5 player1y = temp6 return _Control_Player0_Joystick if joy0left then player0x = player0x - 1 if joy0right then player0x = player0x + 1 if joy0up then pfscroll down return _Control_GameFrames_Control pfscroll down gameFrames = gameFrames + 1 if gameFrames = 5 then pfscroll downdown if gameFrames = 10 then player0_frame = player0_frame + 1 : gameFrames = 0 if player0_design = 0 && player0_frame > 2 then player0_frame = 0 return _Control_Music_Playing mdelaycounter=mdelaycounter+1 : if mdelaycounter>8 then mdelaycounter=0 if mdelaycounter>0 then goto aftermusic AUDC0=4 temp7=_Music0[mindex] if temp7>0 then temp6=8 else temp6=0 AUDF0=temp7 AUDV0=4: rem temp6 AUDC1=12 temp7=_Music1[mindex] if temp7>0 then bassvol=4 : bassfreq=temp7 AUDF1=bassfreq AUDV1=bassvol if bassvol>0 then bassvol=bassvol-1 : if mindex>80 then bassvol=bassvol-2 if bassvol>200 then bassvol=0 mindex=mindex+1 : if mindex>87 then mindex=0 aftermusic return _Control_Player1_Painting if player1_design = Flag then player1: %10000000 %10000000 %10000000 %11100000 %11111100 %11111111 %11111100 %11100000 end if player1_design = Flag then player1color: $00 $00 $00 $57 $57 $57 $57 $57 $57 end if player1_design = Metroid_EnergyTank then player1color: $C4 $44 $2C $2C $44 $2C $2C $2C $2C $2C $44 end if player1_design = Metroid_EnergyTank then player1: %11111111 %10100101 %10100101 %00000000 %00111100 %01011010 %11010011 %11011011 %11010011 %01011010 %00111100 end return _Control_Player0_Painting COLUP0 = $60 if player0_design = 0 && player0_frame = 0 then player0: %00000000 %10111101 %11100111 %10100101 %00100100 %00111100 %00011000 %11011011 %11111111 %11000011 %00000000 end if player0_design = 0 && player0_frame = 1 then player0: %00000000 %10111101 %11100111 %10100101 %00100100 %00111100 %00011000 %11011011 %00111100 %11000011 %00000000 end return _Control_Playfield_002_Colors COLUBK = $08 COLUPF = $99 return _Control_Playfield_001_Setup if playfield_design = 0 then playfield: ................XXXXXXXX....XXXX ................................ ................................ .XXXXX.......................... X.X.X.X......................... XXXXXXX......................... X.X.X.X......................... X.X.X.X......................... XXXXXXX......................... ................................ ................................ ................XXXXXX....XXXXXX end return _Control_Scorebars_001_Setup pfscore1 = %10101010 : pfscore2 = %11111111 return _Control_Scorebars_002_Colors scorecolor = $14 pfscorecolor = $F2 return _Control_002_GAMESTATUS____________________________________ROUTINES _level_image_loop gosub _Control_Playfield_001_Setup gosub _Control_Playfield_002_Colors gosub _Control_Scorebars_002_Colors level_value = 15 if level_value < 10 then player1x = 70 if level_value > 10 then player1x = 65 player0x = 70 player0y = 80 player1y = 35 COLUP0 = $44 COLUP1 = $99 COLUBK = $08 COLUPF = $D4 rem NUSIZ0 = $05 rem NUSIZ1 = $05 player0: %10000000 %10000000 %10000000 %11100000 %11111100 %11111111 %11111100 %11100000 end if level_value = 0 then player1: %00001110 %00001010 %00001010 %00001010 %00001110 %00000000 end if level_value = 1 then player1: %00001110 %00000100 %00000100 %00001100 %00000100 %00000000 end if level_value = 2 then player1: %00001110 %00001000 %00001110 %00000010 %00001110 %00000000 end if level_value = 3 then player1: %00001110 %00000010 %00000110 %00000010 %00001110 %00000000 end if level_value = 4 then player1: %00000010 %00000010 %00001110 %00001010 %00001010 %00000000 end if level_value = 5 then player1: %00001110 %00000010 %00001110 %00001000 %00001110 %00000000 end if level_value = 6 then player1: %00001110 %00001010 %00001110 %00001000 %00001110 %00000000 end if level_value = 7 then player1: %00000010 %00000010 %00000010 %00000010 %00001110 %00000000 end if level_value = 8 then player1: %00001110 %00001010 %00001110 %00001010 %00001110 %00000000 end if level_value = 9 then player1: %00000010 %00000010 %00001110 %00001010 %00001110 %00000000 end if level_value = 10 then player1: %11101110 %01001010 %01001010 %11001010 %01001110 %00000000 end if level_value = 11 then player1: %11101110 %01000100 %01000100 %11001100 %01000100 %00000000 end if level_value = 12 then player1: %11101110 %01001000 %01001110 %11000010 %01001110 %00000000 end if level_value = 13 then player1: %11101110 %01000010 %01000110 %11000010 %01001110 %00000000 end if level_value = 14 then player1: %11100010 %01000010 %01001110 %11001010 %01001010 %00000000 end if level_value = 15 then player1: %11101110 %01000010 %01001110 %11001000 %01001110 %00000000 end if level_value = 16 then player1: %11101110 %01001010 %01001110 %11001000 %01001110 %00000000 end if level_value = 17 then player1: %11100010 %01000010 %01000010 %11000010 %01001110 %00000000 end if level_value = 18 then player1: %11101110 %01001010 %01001110 %11001010 %01001110 %00000000 end if level_value = 19 then player1: %11100010 %01000010 %01001110 %11001010 %01001110 %00000000 end if level_value = 20 then player1: %11101110 %10001010 %11101010 %00101010 %11101110 %00000000 end if level_value = 21 then player1: %11101110 %10000100 %11100100 %00101100 %11100100 %00000000 end if level_value = 22 then player1: %11101110 %10001000 %11101110 %00100010 %11101110 %00000000 end if level_value = 23 then player1: %11101110 %10000010 %11100110 %00100010 %11101110 %00000000 end if level_value = 24 then player1: %11100010 %10000010 %11101110 %00101010 %11101010 %00000000 end if level_value = 25 then player1: %11101110 %10000010 %11101110 %00101000 %11101110 %00000000 end if level_value = 26 then player1: %11101110 %10001010 %11101110 %00101000 %11101110 end if level_value = 27 then player1: %11100010 %10000010 %11100010 %00100010 %11101110 %00000000 end if level_value = 28 then player1: %11101110 %10001010 %11101110 %00101010 %11101110 %00000000 end if level_value = 29 then player1: %11100010 %10000010 %11101110 %00101010 %11101110 %00000000 end if level_value = 30 then player1: %11101110 %00101010 %01101010 %00101010 %11101110 %00000000 end if level_value = 31 then player1: %11101110 %00100100 %01100100 %00101100 %11100100 end if joy0fire then return drawscreen goto _level_image_loop