set kernel_options no_blank_lines set romsize 8kSC data notes 14, 17, 15, 19, 20, 17, 15, 15 14, 17, 15, 19, 20, 17, 19, 19, 14 end data bass_notes 22, 22, 24, 24, 26, 26, 24, 24, 22, 22, 24, 24, 26, 26, 30, 30 end ;``````````````````````````````````````````````````````````````` ; Splits up the score into 3 parts. ; dim _sc1 = score dim _sc2 = score+1 dim _sc3 = score+2 ;*************************************************************** ; ; Enables pfscore bars. ; const pfscore = 1 ;*************************************************************** ; ; Sets up pfscore bars. ; pfscore1 = %10101010 : pfscore2 = %11111111 dim p0_x = a dim p0_y = b dim p1_x = c dim p1_y = d dim p2_x = e dim p2_y = f dim p3_x = g dim p3_y = h rem west, ost, sued, nord dim p0_direction = i dim p1_direction = j dim p2_direction = k dim p3_direction = l rem 0-5 dim p0_action = m dim p1_action = n dim p2_action = o dim p3_action = p dim gameFrame = y dim fspeed = z dim timer = t dim p0_stop = u dim p1_stop = x dim p2_stop = v dim p3_stop = w dim temp_pos_01 = q dim temp_pos_02 = r bank 1 temp1=temp1 const pfres=23 __Start_Restart p0_stop = 0 p0_direction = 4 p1_direction = 4 p2_direction = 4 p3_direction = 4 p0_action = 0 p1_action = 0 p2_action = 0 p3_action = 0 NUSIZ1 = $20 NUSIZ0 = $20 playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX X..............................X X..............................X X..............XXX.............X X............XXXXXXX...........X X............X.X.X.X...........X X...........XXXXXXXXX..........X X...........X.X...X.X..........X X...........XXX...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....XXXXX..XXXXXXXX..XXXXX....X XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end p0_x = 1 : p0_y = 3 p1_x = 8 : p1_y = 8 p2_x = 16 : p2_y = 8 p3_x = 24 : p3_y = 8 __Main_Loop scorecolor = $cB pfscorecolor = $23 COLUBK = $00 : COLUPF = $CB : COLUP0 = $FF : COLUP1 = $F8 CTRLPF = 1 if p0_action = 0 && joy0left && !joy0fire then p0_action = 1 : p0_direction = 1 if p0_action = 0 && joy0right && !joy0fire then p0_action = 1 : p0_direction = 0 if p0_action = 0 && joy0down && !joy0fire then p0_action = 1 : p0_direction = 2 if p0_action = 0 && joy0up && !joy0fire then p0_action = 1 : p0_direction = 3 if p0_x && p1_x && p1_direction = 1 then p1_direction = 0 rem fspeed is the game's framerate. Every 6 loops, all animated sprites will advance 1 frame (gameframe) rem All sprites can have up to a maximum of 8 frames fspeed = fspeed + 1 if fspeed=2 then gosub _walk_player if fspeed=4 then gosub _walk_player if fspeed=8 then gosub _walk_player if fspeed=8 then gameFrame=gameFrame + 1 : fspeed=0 if gameFrame = 8 then gameFrame = 0 temp1 = fspeed & 1 if temp1 then updateSprite4 updateSprite2 temp1 = fspeed & 3 gosub Sprite2 goto DrawFrame updateSprite4 gosub Sprite4 DrawFrame drawscreen updateSprite3 gosub Sprite3 updateSprite1 gosub Sprite1 goto __Main_Loop _player0_point gosub _goto_random_playfield return _player1_point gosub _goto_random_playfield return Sprite1 player0x = (p0_x * 4 ) + 17 player0y = (p0_y * 4) + 11 goto Sprite1Frames Sprite2 player1x = (p1_x * 4 ) + 17 player1y = (p1_y * 4 ) + 11 goto Sprite2Frames return Sprite3 player1x = (p2_x * 4 ) + 17 player1y = (p2_y * 4 ) + 11 goto Sprite3Frames return Sprite4 player0x = (p3_x * 4 ) + 17 player0y = (p3_y * 4 ) + 11 goto Sprite4Frames return Sprite1Frames on gameFrame goto Shape1_1 Shape1_1 Shape1_1 Shape1_1 Shape1_1 Shape1_1 Shape1_1 Shape1_1 Sprite2Frames on gameFrame goto Shape2_1 Shape2_1 Shape2_1 Shape2_1 Shape2_1 Shape2_1 Shape2_1 Shape2_1 Sprite3Frames if p1_direction = 0 then on gameFrame goto Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 if p1_direction = 1 then on gameFrame goto Shape3_3 Shape3_4 Shape3_3 Shape3_4 Shape3_3 Shape3_4 Shape3_3 Shape3_4 if p1_direction = 2 then on gameFrame goto Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 if p1_direction = 3 then on gameFrame goto Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 if p1_direction = 4 then on gameFrame goto Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 Shape3_1 Shape3_2 Sprite4Frames on gameFrame goto Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape1_1 player0: %01111110 %11000011 %10111101 %11100111 %01111110 %01011010 %11111111 %01000010 end return rem mouse Shape2_1 player1: %00111000 %01111100 %11000110 %01101100 %11010110 %11111110 %01101110 end return rem cat Shape3_1 player1: %10101010 %01111110 %10000100 %10001010 %10010101 %01001110 %00001010 end return Shape3_2 player1: %01011010 %01111110 %10000100 %10001010 %10010101 %01001110 %00001010 end return Shape3_3 player1: %01010101 %01111110 %00100001 %01010001 %10101001 %01110010 %01010000 end return Shape3_4 player1: %01011010 %01111110 %00100001 %01010001 %10101001 %01110010 %01010000 end return Shape4_1 player0: %00111000 %01111100 %11000110 %01101100 %11010110 %11111110 %01101110 end return rem 0 rechts rem 1 links rem 2 runter rem 3 hoch _check_collison_p0 p0_stop = 0 rem joy0up if p0_direction = 3 then temp_pos_01 = p0_x : temp_pos_02 = temp_pos_01 + 1 : temp5 = p0_y if p0_direction = 3 && pfread(temp_pos_01,temp5) then p0_stop = 1 : p0_action = 0 : goto _skip_up if p0_direction = 3 && pfread(temp_pos_02,temp5) then p0_stop = 1 : p0_action = 0 : goto _skip_up _skip_up rem joy0right if p0_direction = 0 then temp_pos_01 = p0_x + 2 : temp5 = p0_y + 1 : temp6 = temp5 + 1 if p0_direction = 0 && pfread(temp_pos_01,temp5) then p0_stop = 1 : p0_action = 0 : goto _skip_right if p0_direction = 0 && pfread(temp_pos_01,temp6) then p0_stop = 1 : p0_action = 0 : goto _skip_right _skip_right rem joy0leftt if p0_direction = 1 then temp_pos_01 = p0_x - 1 : temp5 = p0_y + 1 : temp6 = temp5 + 1 if p0_direction = 1 && pfread(temp_pos_01,temp5) then p0_stop = 1 : p0_action = 0 : goto _skip_left if p0_direction = 1 && pfread(temp_pos_01,temp6) then p0_stop = 1 : p0_action = 0 : goto _skip_left _skip_left rem joy0down if p0_direction = 2 then temp_pos_01 = p0_x : temp_pos_02 = temp_pos_01 + 1 : temp5 = p0_y + 3 : temp6 = temp5 if p0_direction = 2 && pfread(temp_pos_01,temp5) then p0_stop = 1 : p0_action = 0 : goto _skip_down if p0_direction = 2 && pfread(temp_pos_02,temp6) then p0_stop = 1 : p0_action = 0 : goto _skip_down _skip_down return _check_collison_p1 return _check_collison_p2 return _check_collison_p3 return _walk_player rem p0 hund rem p2 cat rem p1 mouse rem p3 mouse gosub _check_collison_p0 gosub _check_collison_p1 gosub _check_collison_p2 gosub _check_collison_p3 if p0_stop = 0 && p0_direction = 0 then p0_x = p0_x + 1 : p0_action = 0 if p0_stop = 0 && p0_direction = 1 then p0_x = p0_x - 1 : p0_action = 0 if p0_stop = 0 && p0_direction = 2 then p0_y = p0_y + 1 : p0_action = 0 if p0_stop = 0 && p0_direction = 3 then p0_y = p0_y - 1 : p0_action = 0 if p0_stop = 1 then return if p1_stop = 0 && p1_direction = 0 then p1_x = p1_x + 1 : p1_action = 0 if p1_stop = 0 && p1_direction = 1 then p1_x = p1_x - 1 : p1_action = 0 if p1_stop = 0 && p1_direction = 2 then p1_y = p1_y + 1 : p1_action = 0 if p1_stop = 0 && p1_direction = 3 then p1_y = p1_y - 1 : p1_action = 0 if p2_stop = 0 && p2_direction = 0 then p2_x = p2_x + 1 : p2_action = 0 if p2_stop = 0 && p2_direction = 1 then p2_x = p2_x - 1 : p2_action = 0 if p2_stop = 0 && p2_direction = 2 then p2_y = p2_y + 1 : p2_action = 0 if p2_stop = 0 && p2_direction = 3 then p2_y = p2_y - 1 : p2_action = 0 if p3_stop = 0 && p3_direction = 0 then p3_x = p3_x + 1 : p3_action = 0 if p3_stop = 0 && p3_direction = 1 then p3_x = p3_x - 1 : p3_action = 0 if p3_stop = 0 && p3_direction = 2 then p3_y = p3_y + 1 : p3_action = 0 if p3_stop = 0 && p3_direction = 3 then p3_y = p3_y - 1 : p3_action = 0 return _goto_random_playfield goto _random_playfield bank2 _finish_random_playfield return bank 2 _random_playfield _random_p3 rem p3_x = (rand&15) rem p3_y = (rand&15) rem temp6 = p3_x + 1 rem temp5 = p3_y + 2 rem if pfread(temp6,temp5) then gosub _random_p3 rem temp6 = p3_x + 1 rem temp5 = p3_y rem if pfread(temp6,temp5) then gosub _random_p3 rem temp6 = p3_x + 1 rem temp5 = p3_y - 1 rem if pfread(temp6,temp5) then gosub _random_p3 rem p2_x = (rand&15) rem p2_y = (rand&15) goto _finish_random_playfield bank1 inline playerscores.asm inline bcd_math.asm