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 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 maze_top = m dim maze_middle = m dim maze_bottom = m dim _Loop = q dim _Loop_End = r dim _Random = s dim gameFrame = y dim fspeed = z dim timer = t dim temp_pos_01 = q dim temp_pos_02 = r bank 1 temp1=temp1 const pfres=23 p0_direction = 0 __Start_Restart NUSIZ1 = $25 player1x = 15 : player1y = 30 p0_x = 0 p0_y = 0 rem uboot p0_direction = 0 p0_action = 0 playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 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 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end p0_x = 1 : p0_y = 3 p1_x = 8 : p1_y = 18 p2_x = 16 : p2_y = 0 p3_x = 24 : p3_y = 12 gosub _goto_random_playfield timer = 0 __Main_Loop if timer= 4 then AUDC0=0 : AUDF0=0 : AUDV0=0 if p0_x = p3_x && p0_y = p3_y then gosub _player0_point if p1_x = p2_x && p1_y = p2_y then gosub _player1_point scorecolor = $8A COLUBK = $A2 COLUPF = $00 COLUP0 = $1E COLUP1 = $0E 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 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 timer = timer + 1 rem 0 rechts rem 1 links rem 2 runter rem 3 hoch if timer = 8 && p0_direction = 0 then p0_x = p0_x + 1 : timer = 0 : p0_action = 0 : gosub _play_down if timer = 8 && p0_direction = 1 then p0_x = p0_x - 1 : timer = 0 : p0_action = 0 : gosub _play_down if timer = 8 && p0_direction = 2 then p0_y = p0_y + 1 : timer = 0 : p0_action = 0 : gosub _play_down if timer = 8 && p0_direction = 3 then p0_y = p0_y - 1 : timer = 0 : p0_action = 0 : gosub _play_down 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 gosub _check_collison_p0 player0x = (p0_x * 4 ) + 17 player0y = (p0_y * 4) + 11 goto Sprite1Frames Sprite2 gosub _check_collison_p1 player1x = (p1_x * 4 ) + 17 player1y = (p1_y * 4 ) + 11 goto Sprite2Frames return Sprite3 player1x = (p2_x * 4 ) + 17 player1y = (p2_y * 4 ) + 10 goto Sprite3Frames return Sprite4 player0x = (p3_x * 4 ) + 17 player0y = (p3_y * 4 ) + 10 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 on gameFrame goto Shape3_1 Shape3_1 Shape3_1 Shape3_1 Shape3_1 Shape3_1 Shape3_1 Shape3_1 Sprite4Frames on gameFrame goto Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 Shape4_1 _play_point AUDC1=20 : AUDF1=5 : AUDV1=7 AUDC0=20 : AUDF0=5 : AUDV0=7 return _play_left AUDC0=9 : AUDF0=8 : AUDV0=2 return _play_right AUDC0=9 : AUDF0=8 : AUDV0=2 return _play_up AUDC0=11 : AUDF0=8 : AUDV0=4 return _play_down AUDC0=11 : AUDF0=8 : AUDV0=4 return _play_ladder AUDC0=12 : AUDF0=8 : AUDV0=2 return _play_falling AUDC1=9 : AUDF1=7 : AUDV1=2 return Shape1_1 player0: %01111110 %11111111 %11011011 %01111110 %00011000 %00011100 end return Shape2_1 player1: %01111110 %11111111 %11011011 %01111110 %00011000 %00011100 end return Shape3_1 player1: %11111111 %11111111 %11111111 %11111111 %11111111 end return Shape4_1 player0: %11111111 %11111111 %11111111 %11111111 %11111111 end return rem 0 rechts rem 1 links rem 2 runter rem 3 hoch _check_collison_p0 rem joy0up if p0_direction = 3 then temp_pos_01 = p0_x : temp_pos_02 = temp_pos_01 + 1 : temp5 = p0_y + 1 : temp6 = temp5 if p0_direction = 3 && pfread(temp_pos_01,temp5) then p0_y = p0_y + 1 : goto _skip_up if p0_direction = 3 && pfread(temp_pos_02,temp6) then p0_y = p0_y + 1 : goto _skip_up _skip_up rem joy0right if p0_direction = 0 then temp_pos_01 = p0_x + 1 : temp5 = p0_y + 1 : temp6 = temp5 + 1 if p0_direction = 0 && pfread(temp_pos_01,temp5) then p0_x = p0_x - 1 : goto _skip_right if p0_direction = 0 && pfread(temp_pos_01,temp6) then p0_x = p0_x - 1 : goto _skip_right _skip_right rem joy0leftt if p0_direction = 1 then temp_pos_01 = p0_x : temp5 = p0_y + 1 : temp6 = temp5 + 1 if p0_direction = 1 && pfread(temp_pos_01,temp5) then p0_x = p0_x + 1 : goto _skip_left if p0_direction = 1 && pfread(temp_pos_01,temp6) then p0_x = p0_x + 1 : 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 + 2 : temp6 = temp5 if p0_direction = 2 && pfread(temp_pos_01,temp5) then p0_y = p0_y - 1 : goto _skip_down if p0_direction = 2 && pfread(temp_pos_02,temp6) then p0_y = p0_y - 1 : goto _skip_down _skip_down return _check_collison_p1 rem joy0up if p1_direction = 1 then temp_pos_01 = p1_x : temp_pos_02 = temp_pos_01 + 1 : temp5 = p1_y + 1 : temp6 = temp5 if p1_direction = 1 && pfread(temp_pos_01,temp5) then p1_y = p1_y + 1 : goto _skip_up_p1 if p1_direction = 1 && pfread(temp_pos_02,temp6) then p1_y = p1_y + 1 : goto _skip_up_p1 _skip_up_p1 rem joy0right if p1_direction = 2 then temp_pos_01 = p1_x + 1 : temp5 = p1_y + 1 : temp6 = temp5 + 1 if p1_direction = 2 && pfread(temp_pos_01,temp5) then p1_x = p1_x - 1 : goto _skip_right_p1 if p1_direction = 2 && pfread(temp_pos_01,temp6) then p1_x = p1_x - 1 : goto _skip_right_p1 _skip_right_p1 rem joy0leftt if p1_direction = 0 then temp_pos_01 = p1_x : temp5 = p1_y + 1 : temp6 = temp5 + 1 if p1_direction = 0 && pfread(temp_pos_01,temp5) then p1_x = p1_x + 1 : goto _skip_left_p1 if p1_direction = 0 && pfread(temp_pos_01,temp6) then p1_x = p1_x + 1 : goto _skip_left_p1 _skip_left_p1 rem joy0down if p1_direction = 3 then temp_pos_01 = p1_x : temp_pos_02 = temp_pos_01 + 1 : temp5 = p1_y + 2 : temp6 = temp5 if p1_direction = 3 && pfread(temp_pos_01,temp5) then p1_y = p1_y - 1 : goto _skip_down_p1 if p1_direction = 3 && pfread(temp_pos_02,temp6) then p1_y = p1_y - 1 : goto _skip_down_p1 _skip_down_p1 return _goto_random_playfield goto _random_playfield bank2 _finish_random_playfield return bank 2 data y_pos 0,3,6,9,12,15,18,0 end data x_pos 1,4,7,10,13,15,18,23,29, 1,4,7,10,13,15,18 end _random_playfield rem ```````````````````````````````````````````````````````````````` rem ` Get random number between 0 and 15. rem ` _Loop_End = 59 - 36 _Random = (rand&7) temp1 = _Random if _Random = 0 then gosub __Maze_Top_01 if _Random = 1 then gosub __Maze_Top_02 if _Random = 2 then gosub __Maze_Top_03 if _Random = 3 then gosub __Maze_Top_04 if _Random = 4 then gosub __Maze_Top_05 if _Random = 5 then gosub __Maze_Top_06 if _Random = 6 then gosub __Maze_Top_07 if _Random = 7 then gosub __Maze_Top_08 _Loop_End = 87 - 60 _Random = (rand&7) temp2 = _Random if _Random = 0 then gosub __Maze_Mid_01 if _Random = 1 then gosub __Maze_Mid_02 if _Random = 2 then gosub __Maze_Mid_03 if _Random = 3 then gosub __Maze_Mid_04 if _Random = 4 then gosub __Maze_Mid_05 if _Random = 5 then gosub __Maze_Mid_06 if _Random = 6 then gosub __Maze_Mid_07 if _Random = 7 then gosub __Maze_Mid_08 _Loop_End = 123 - 88 _Random = (rand&7) temp3 = _Random if _Random = 0 then gosub __Maze_Bot_01 if _Random = 1 then gosub __Maze_Bot_02 if _Random = 2 then gosub __Maze_Bot_03 if _Random = 3 then gosub __Maze_Bot_04 if _Random = 4 then gosub __Maze_Bot_05 if _Random = 5 then gosub __Maze_Bot_06 if _Random = 6 then gosub __Maze_Bot_07 if _Random = 7 then gosub __Maze_Bot_08 rem zufall auf brett prosition setzen rem alle positionen _random_p3 temp5 = (rand&15) temp6 = (rand&7) p3_x = x_pos[temp5] p3_y = y_pos[temp6] if pfread(p3_x,p3_y) then goto _random_p3 _random_p2 temp5 = (rand&15) temp6 = (rand&7) p2_x = x_pos[temp5] p2_y = y_pos[temp6] if pfread(p3_x,p3_y) then goto _random_p2 rem if pfread(p3_x,p3_y) then goto _random_p2 goto _finish_random_playfield bank1 rem **************************************************************** rem **************************************************************** rem * rem * Playfield data for top piece. rem * rem ```````````````````````````````````````````````````````````````` rem ` data _Top_01 $FF,$FF,$FF,$FF,$80,$02,$02,$80,$80,$02,$02,$80,$9E,$F2,$F2,$9E, $80,$00,$00,$80,$80,$00,$00,$80 end data _Top_02 $FF,$FF,$FF,$FF,$80,$00,$00,$80,$80,$00,$00,$80,$9F,$F3,$F3,$9F, $80,$02,$02,$80,$80,$02,$02,$80 end data _Top_03 $FF,$FF,$FF,$FF,$80,$00,$00,$80,$80,$00,$00,$80,$9E,$F2,$F2,$9E, $80,$02,$02,$80,$80,$02,$02,$80 end data _Top_04 $FF,$FF,$FF,$FF,$80,$00,$00,$80,$80,$00,$00,$80,$9F,$C9,$C9,$9F, $80,$08,$08,$80,$80,$08,$08,$80 end data _Top_05 $FF,$FF,$FF,$FF,$80,$08,$08,$80,$80,$08,$08,$80,$9F,$C9,$C9,$9F, $80,$00,$00,$80,$80,$00,$00,$80 end data _Top_06 $FF,$FF,$FF,$FF,$80,$00,$00,$80,$80,$00,$00,$80,$9E,$FE,$FE,$9E, $80,$00,$00,$80,$80,$00,$00,$80 end data _Top_07 $FF,$FF,$FF,$FF,$80,$00,$00,$80,$80,$00,$00,$80,$9F,$CF,$CF,$9F, $80,$00,$00,$80,$80,$00,$00,$80 end data _Top_08 $FF,$FF,$FF,$FF,$81,$00,$00,$81,$81,$00,$00,$81,$99,$FC,$FC,$99, $80,$00,$00,$80,$80,$00,$00,$80 end rem **************************************************************** rem **************************************************************** rem * rem * Playfield data for middle piece. rem * rem ```````````````````````````````````````````````````````````````` rem ` data _Middle_01 $9E,$4E,$4E,$9E,$82,$40,$40,$82,$82,$40,$40,$82,$92,$7E,$7E,$92, $90,$00,$00,$90,$90,$00,$00,$90,$9E,$7E,$7E,$9E end data _Middle_02 $9E,$CE,$CE,$9E,$80,$02,$02,$80,$80,$02,$02,$80,$F2,$72,$72,$F2, $82,$00,$00,$82,$82,$00,$00,$82,$9E,$7E,$7E,$9E end data _Middle_03 $9E,$CE,$CE,$9E,$82,$00,$00,$82,$82,$00,$00,$82,$F2,$FE,$FE,$F2, $82,$00,$00,$82,$82,$00,$00,$82,$9E,$7E,$7E,$9E end data _Middle_04 $F2,$CE,$CE,$F2,$82,$00,$00,$82,$82,$00,$00,$82,$93,$F9,$F9,$93, $90,$00,$00,$90,$90,$00,$00,$90,$9E,$7E,$7E,$9E end data _Middle_05 $9E,$CE,$CE,$9E,$82,$00,$00,$82,$82,$00,$00,$82,$F2,$72,$72,$F2, $80,$02,$02,$80,$80,$02,$02,$80,$9E,$7E,$7E,$9E end data _Middle_06 $FE,$CE,$CE,$FE,$80,$02,$02,$80,$80,$02,$02,$80,$9F,$F3,$F3,$9F, $80,$00,$00,$80,$80,$00,$00,$80,$9E,$7E,$7E,$9E end data _Middle_07 $FE,$CE,$CE,$FE,$80,$08,$08,$80,$80,$08,$08,$80,$93,$49,$49,$93, $90,$40,$40,$90,$90,$40,$40,$90,$9E,$7E,$7E,$9E end data _Middle_08 $9E,$4E,$4E,$9E,$90,$40,$40,$90,$90,$40,$40,$90,$93,$73,$73,$93, $90,$00,$00,$90,$90,$00,$00,$90,$9E,$7E,$7E,$9E end rem **************************************************************** rem **************************************************************** rem * rem * Playfield data for bottom piece. rem * rem ```````````````````````````````````````````````````````````````` rem ` data _Bottom_01 $80,$00,$00,$80,$80,$00,$00,$80,$F2,$FE,$FE,$F2,$82,$00,$00,$82, $82,$00,$00,$82,$9F,$F3,$F3,$9F,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end data _Bottom_02 $80,$00,$00,$80,$80,$00,$00,$80,$9E,$FE,$FE,$9E,$90,$00,$00,$90, $90,$00,$00,$90,$93,$FF,$FF,$93,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end data _Bottom_03 $80,$00,$00,$80,$80,$00,$00,$80,$FF,$4F,$4F,$FF,$80,$40,$40,$80, $80,$40,$40,$80,$9F,$7F,$7F,$9F,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end data _Bottom_04 $80,$00,$00,$80,$80,$00,$00,$80,$FE,$F2,$F2,$FE,$80,$02,$02,$80, $80,$02,$02,$80,$9F,$73,$73,$9F,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end data _Bottom_05 $80,$02,$02,$80,$80,$02,$02,$80,$93,$F3,$F3,$93,$90,$00,$00,$90, $90,$00,$00,$90,$9F,$F3,$F3,$9F,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end data _Bottom_06 $82,$40,$40,$82,$82,$40,$40,$82,$F2,$4E,$4E,$F2,$80,$00,$00,$80, $80,$00,$00,$80,$9F,$F3,$F3,$9F,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end data _Bottom_07 $80,$00,$00,$80,$80,$00,$00,$80,$F2,$FE,$FE,$F2,$82,$00,$00,$82, $82,$00,$00,$82,$9E,$F2,$F2,$9E,$80,$02,$02,$80,$80,$02,$02,$80, $FF,$FF,$FF,$FF end data _Bottom_08 $80,$00,$00,$80,$80,$00,$00,$80,$FE,$F2,$F2,$FE,$80,$02,$02,$80, $80,$02,$02,$80,$9F,$7F,$7F,$9F,$80,$00,$00,$80,$80,$00,$00,$80, $FF,$FF,$FF,$FF end rem **************************************************************** rem **************************************************************** rem * rem * Reads playfield data for top piece. rem * rem ```````````````````````````````````````````````````````````````` rem ` __Maze_Top_01 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_01[_Loop] next return __Maze_Top_02 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_02[_Loop] next return __Maze_Top_03 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_03[_Loop] next return __Maze_Top_04 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_04[_Loop] next return __Maze_Top_05 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_05[_Loop] next return __Maze_Top_06 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_06[_Loop] next return __Maze_Top_07 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_07[_Loop] next return __Maze_Top_08 for _Loop = 0 to _Loop_End w036[_Loop] = _Top_08[_Loop] next return rem **************************************************************** rem **************************************************************** rem * rem * Reads playfield data for middle piece. rem * rem ```````````````````````````````````````````````````````````````` rem ` __Maze_Mid_01 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_01[_Loop] next return __Maze_Mid_02 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_02[_Loop] next return __Maze_Mid_03 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_03[_Loop] next return __Maze_Mid_04 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_04[_Loop] next return __Maze_Mid_05 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_05[_Loop] next return __Maze_Mid_06 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_06[_Loop] next return __Maze_Mid_07 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_07[_Loop] next return __Maze_Mid_08 for _Loop = 0 to _Loop_End w060[_Loop] = _Middle_08[_Loop] next return rem **************************************************************** rem **************************************************************** rem * rem * Reads playfield data for bottom piece. rem * rem ```````````````````````````````````````````````````````````````` rem ` __Maze_Bot_01 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_01[_Loop] next return __Maze_Bot_02 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_02[_Loop] next return __Maze_Bot_03 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_03[_Loop] next return __Maze_Bot_04 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_04[_Loop] next return __Maze_Bot_05 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_05[_Loop] next return __Maze_Bot_06 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_06[_Loop] next return __Maze_Bot_07 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_07[_Loop] next return __Maze_Bot_08 for _Loop = 0 to _Loop_End w088[_Loop] = _Bottom_08[_Loop] next return inline playerscores.asm inline bcd_math.asm