; HEIST v. 1.3 ; For the Atari 2600 ; By Timothy J. Marsh (c) 2019 include div_mul.asm set kernel DPC+ set tv ntsc set optimization speed set dpcspritemax 6 ; We are only using 6 of the 9 possible player 1 sprites ;*** Variables dim _P0_NUSIZ = a dim _frames = b dim _quarterSeconds = c dim _moveCounter = d dim _level = e dim _difficulty = f dim _bulletCount = g dim _pfSelection = h dim _pfExit = i dim _CountdownSpeed = j dim _M0_Dir_Latch = k dim _Ch0_Sound = l dim _Ch0_Duration = m dim _Ch0_Counter = n dim _Ch1_Sound = o dim _Ch1_Duration = p dim _Ch1_Counter = q dim _Bit0_Reset_Restrainer = r dim _Bit1_FinalGuardUnleashed= r dim _Bit2_J0_Diag_Up = r dim _Bit3_J0_Diag_Down = r dim _Bit4_P0_Not_Moving = r dim _Bit5_Transition_Latch = r dim _Bit6_FireOneShot = r dim _rBit7_SPARE = r dim _Bit0_J0_Up_Latch = s dim _Bit1_J0_Down_Latch = s dim _Bit2_J0_Left_Latch = s dim _Bit3_J0_Right_Latch = s dim _Bit4_M0_Flip_P0_Latch = s dim _Bit5_Flip_P0 = s dim _Bit6_Game_Over = s dim _Bit7_M0_Moving = s dim _Bit0_Money_Captured = t dim _Bit1_P1_Moving = t dim _Bit2_P2_Moving = t dim _Bit3_P3_Moving = t dim _Bit4_Player1_Moves = t dim _Bit5_Player2_Moves = t dim _Bit6_Player3_Moves = t dim _Bit7_DoorOpened = t dim P1_Counter = u dim _M0_Height = v dim _Player5_X_Pos_2 = w dim _Player5_Y_Pos_2 = x dim _Player6_X_Pos_2 = y dim _Player6_Y_Pos_2 = z dim _GameNo = var0 dim _GameFlipped = var1 dim _Lives = var2 dim _shootDir = var3 dim _Bit0_PlayfieldColorSelected = var4 dim _4Bit1_SPARE = var4 dim _v4Bit2_SPARE = var4 dim _v4Bit3_SPARE = var4 dim _v4Bit4_SPARE = var4 dim _v4Bit5_SPARE = var4 dim _v4Bit6_SPARE = var4 dim _v4Bit7_SPARE = var4 dim _M0_Width = var5 ; note: we do not use the 6-9th sprites so the following variables are available for program use: player7x, player7y, NUSIZ7, player7height, player8x, player8y, NUSIZ8, player8height, player9x, player9y, NUSIZ9, player9height ; dim _sc1 = score ; Splits up the score into 3 parts - useful for displaying values via the score display -- for debugging ; dim _sc2 = score+1 ; Splits up the score into 3 parts - useful for displaying values via the score display -- for debugging ; dim _sc3 = score+2 ; Splits up the score into 3 parts - useful for displaying values via the score display -- for debugging ;*** Constants const fontstyle = TINY ; sets score text font ; see score_graphics.asm const pfscore = 1 ; show power bar(s) goto __Bank_2 bank2 ;********************************************* ; BEGIN BANK 2 ;********************************************* bank 2 temp1=temp1 ; needed by DPC+ Kernel __Bank_2 ;*** Clear Level on Initial Startup _level = 254 _GameFlipped = 0 _GameNo = 1 __Start_Restart score = 0 __PlayNextLife a = 0 : b = 0 : c = 0 : d = 0 : f = 0 : g = 0 : h = 0 : i = 0 ; Clear Variables but not e, var0 or var1 because they hold the level, game no. and lives values j = 0 : k = 0 : l = 0 : m = 0 : n = 0 : o = 0 : p = 0 : q = 0 : r = 0 s = 0 : t = 0 : u = 0 : v = 0 : w = 0 : x = 0 : y = 0 : z = 0 var3 = 0 : var4 = 0 var5 = 0 : var6 = 0 : var7 = 0 : var8 = 0 player7x = 0: player7y = 0 : NUSIZ7 = 0 : player7height = 0 player8x = 0: player8y = 0 : NUSIZ8 = 0 : player8height = 0 player9x = 0: player9y = 0 : NUSIZ9 = 0 : player9height = 0 AUDV0 = 0 : AUDV1 = 0 ; Mute both sound channels COLUM0 = $FE : COLUM1 = $74 ; set Missile0 and Missile 1 Colors ballx = 20 : bally = 200 ; we are not using the ball so move off-scteen ;*** Set certain initial Sprite shapes and colors. -- Note that animation is handled in main loop player0color: $0A $02 $06 $08 $0C $06 $0C $08 $06 $0A $0A end player1-3: %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00011000 %00011000 %00101000 end player1-3color: $8A $88 $84 $88 $8C $86 $8C $88 $84 $88 $8A end ; dollar sign player4: %00001000 %00011110 %00101000 %00101000 %00011100 %00001010 %00001010 %00111100 %00001000 end player4color: $C8 $C8 $C8 $C8 $C8 $C8 $C8 $C8 $C8 end player5: %11111111 %11111111 %11111111 end player5color: $34 $34 $34 end player6: %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 %00011000 end player6color: $34 $34 $34 $34 $34 $34 $34 $34 $34 $34 $34 end if _level=254 then goto __TitleScreen bank6 ; launch title screen only on initial boot __levelComplete _frames=0:_quarterSeconds=0 : _moveCounter = 0; reset timers _Bit0_PlayfieldColorSelected{0} = 0 : _Bit7_DoorOpened = 0 if _level=255 then _level=0 _level = _level + 1 ; increment level if _GameNo = 3 || _GameNo = 6 then _level = _level + 1 ; increment level again if _level = 21 then _level = 1 : _GameFlipped = 1 pfclear ;*** Define Levels ; in general, valid X ranges & 19-133 & Y ranges 6-159 - If you are not useing one of the Police sprites then position it at x=20 y=220 ; player1-3 = movable police ; player4 = target (Dollar Sign) ; player5 = horizontal trip-wire ; player6 = vertical trip-wire ; player7-9 = Not Used ; _CountdownSpeed: 1 UNIT = 2 SECONDS e.g., _CountdownSpeed = 12 corresponds to 24 seconds - DO NOT EXCEED 31 or may get a math overflow ; _difficulty values determine how fast players1-3 chase player0 (1 = slow / 2 = fast) if _level = 1 then player0x = 30 : player0y = 20 : _Bit5_Flip_P0{5} = 1 :_pfSelection = 1 : _pfExit = 1 : _CountdownSpeed = 15 : _difficulty = 1 : _bulletCount = 6 if _level = 1 then player1x = 120 : player1y = 60 : player2x = 84 : player2y = 146 : player3x = 20 : player3y = 220 : player4x = 125 : player4y = 15 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 94 : player6y = 107 : _Player6_X_Pos_2 = 20 : _Player6_Y_Pos_2 = 220 if _level = 1 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 0 if _level = 2 then player0x = 30 : player0y = 20 : _Bit5_Flip_P0{5} = 1 :_pfSelection = 1 : _pfExit = 1 : _CountdownSpeed = 12 : _difficulty = 2 : _bulletCount = 6 if _level = 2 then player1x = 120 : player1y = 60 : player2x = 84 : player2y = 146 : player3x = 20 : player3y = 220 : player4x = 125 : player4y = 15 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 94 : player6y = 107 : _Player6_X_Pos_2 = 20 : _Player6_Y_Pos_2 = 220 if _level = 2 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 0 if _level = 3 then player0x = 21 : player0y = 25 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 2 : _pfExit = 2 : _CountdownSpeed = 15 : _difficulty = 1 : _bulletCount = 6 if _level = 3 then player1x = 53 : player1y = 20 : player2x = 80 : player2y = 138 : player3x = 120 : player3y = 60 : player4x = 115 : player4y = 31 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 62 : player6y = 83 : _Player6_X_Pos_2 = 79 : _Player6_Y_Pos_2 =83 if _level = 3 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 4 then player0x = 21 : player0y = 25 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 2 : _pfExit = 2 : _CountdownSpeed = 12 : _difficulty = 2 : _bulletCount = 6 if _level = 4 then player1x = 53 : player1y = 20 : player2x = 80 : player2y = 138 : player3x = 120 : player3y = 60 : player4x = 115 : player4y = 31 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 62 : player6y = 83 : _Player6_X_Pos_2 = 79 : _Player6_Y_Pos_2 =83 if _level = 4 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 5 then player0x = 21 : player0y = 83 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 3 : _pfExit = 6 : _CountdownSpeed = 10 : _difficulty = 1 : _bulletCount = 6 if _level = 5 then player1x = 68 : player1y = 105 : player2x = 88 : player2y = 76 : player3x = 53 : player3y = 37 : player4x = 68 : player4y = 124 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 86 : player6y = 150 : _Player6_X_Pos_2 = 120 : _Player6_Y_Pos_2 =150 if _level = 5 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 6 then player0x = 21 : player0y = 83 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 3 : _pfExit = 6 : _CountdownSpeed = 8 : _difficulty = 2 : _bulletCount = 6 if _level = 6 then player1x = 68 : player1y = 105 : player2x = 88 : player2y = 76 : player3x = 53 : player3y = 37 : player4x = 68 : player4y = 124 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 86 : player6y = 150 : _Player6_X_Pos_2 = 120 : _Player6_Y_Pos_2 =150 if _level = 6 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 7 then player0x = 21 : player0y = 25 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 4 : _pfExit = 2 : _CountdownSpeed = 14 : _difficulty = 1 : _bulletCount = 6 if _level = 7 then player1x = 86 : player1y = 156 : player2x = 61 : player2y = 130 : player3x = 130 : player3y = 40 : player4x = 91 : player4y = 81 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 20 : player6y = 220 : _Player6_X_Pos_2 = 20 : _Player6_Y_Pos_2 =220 if _level = 7 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 8 then player0x = 21 : player0y = 25 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 4 : _pfExit = 2 : _CountdownSpeed = 12 : _difficulty = 2 : _bulletCount = 6 if _level = 8 then player1x = 86 : player1y = 156 : player2x = 61 : player2y = 130 : player3x = 130 : player3y = 40 : player4x = 91 : player4y = 81 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 20 : player6y = 220 : _Player6_X_Pos_2 = 20 : _Player6_Y_Pos_2 =220 if _level = 8 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 9 then player0x = 24 : player0y = 80 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 5 : _pfExit = 3 : _CountdownSpeed = 7 : _difficulty = 1 : _bulletCount = 6 if _level = 9 then player1x = 50 : player1y = 115 : player2x = 92 : player2y = 128 : player3x = 130 : player3y = 40 : player4x = 107 : player4y = 82 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 82 : player6y = 15 : _Player6_X_Pos_2 = 82 : _Player6_Y_Pos_2 =152 if _level = 9 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 10 then player0x = 24 : player0y = 80 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 5 : _pfExit = 3 : _CountdownSpeed = 6 : _difficulty = 2 : _bulletCount = 6 if _level = 10 then player1x = 50 : player1y = 115 : player2x = 92 : player2y = 128 : player3x = 130 : player3y = 40 : player4x = 107 : player4y = 82 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 82 : player6y = 15 : _Player6_X_Pos_2 = 82 : _Player6_Y_Pos_2 =152 if _level = 10 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 11 then player0x = 24 : player0y = 80 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 6 : _pfExit = 6 : _CountdownSpeed = 10: _difficulty = 1 : _bulletCount = 5 if _level = 11 then player1x = 58 : player1y = 102 : player2x = 92 : player2y = 124 : player3x = 130 : player3y = 50 : player4x = 101 : player4y = 83 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 82 : player6y = 17 : _Player6_X_Pos_2 = 82 : _Player6_Y_Pos_2 =148 if _level = 11 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 12 then player0x = 24 : player0y = 80 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 6 : _pfExit = 6 : _CountdownSpeed = 8 : _difficulty = 2 : _bulletCount = 5 if _level = 12 then player1x = 58 : player1y = 102 : player2x = 92 : player2y = 124 : player3x = 130 : player3y = 50 : player4x = 101 : player4y = 83 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x = 82 : player6y = 17 : _Player6_X_Pos_2 = 82 : _Player6_Y_Pos_2 =148 if _level = 12 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 13 then player0x = 31 : player0y = 83 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 7 : _pfExit = 4 : _CountdownSpeed = 10 : _difficulty = 1 : _bulletCount = 5 if _level = 13 then player1x = 71 : player1y = 102 : player2x = 71 : player2y = 63 : player3x = 125 : player3y = 80 : player4x = 126 : player4y = 22 : player5x = 132 : player5y = 51 : _Player5_X_Pos_2 = 126 : _Player5_Y_Pos_2 = 124 : player6x = 20 : player6y = 220 : _Player6_X_Pos_2 = 20 : _Player6_Y_Pos_2 =220 if _level = 13 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 14 then player0x = 31 : player0y = 83 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 7 : _pfExit = 4 : _CountdownSpeed = 8 : _difficulty = 2 : _bulletCount = 5 if _level = 14 then player1x = 71 : player1y = 102 : player2x = 71 : player2y = 63 : player3x = 125 : player3y = 80 : player4x = 126 : player4y = 22 : player5x = 132 : player5y = 51 : _Player5_X_Pos_2 = 126 : _Player5_Y_Pos_2 = 124 : player6x = 20 : player6y = 220 : _Player6_X_Pos_2 = 20 : _Player6_Y_Pos_2 =220 if _level = 14 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 15 then player0x = 31 : player0y = 133 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 8 : _pfExit = 2 : _CountdownSpeed = 18 : _difficulty = 1 : _bulletCount = 5 if _level = 15 then player1x = 69 : player1y = 156 : player2x = 130 : player2y = 70 : player3x = 80 : player3y = 10 : player4x = 28 : player4y = 49 : player5x = 130 : player5y = 91 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x =50 : player6y = 27 : _Player6_X_Pos_2 = 86 : _Player6_Y_Pos_2 = 131 if _level = 15 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 16 then player0x = 31 : player0y = 133 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 8 : _pfExit = 2 : _CountdownSpeed = 16 : _difficulty = 2 : _bulletCount = 5 if _level = 16 then player1x = 69 : player1y = 156 : player2x = 130 : player2y = 70 : player3x = 80 : player3y = 10 : player4x = 28 : player4y = 49 : player5x = 130 : player5y = 91 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x =50 : player6y = 27 : _Player6_X_Pos_2 = 86 : _Player6_Y_Pos_2 = 131 if _level = 16 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 17 then player0x = 21 : player0y = 9 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 9 : _pfExit = 4 : _CountdownSpeed = 10 : _difficulty = 1 : _bulletCount = 5 if _level = 17 then player1x = 76 : player1y = 59 : player2x =116 : player2y = 156 : player3x = 97 : player3y = 80 : player4x = 76 : player4y = 108 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x =76 : player6y = 30 : _Player6_X_Pos_2 = 76 : _Player6_Y_Pos_2 = 135 if _level = 17 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 18 then player0x = 21 : player0y = 9 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 9 : _pfExit = 4 : _CountdownSpeed = 8 : _difficulty = 2 : _bulletCount = 5 if _level = 18 then player1x = 76 : player1y = 59 : player2x =116 : player2y = 156 : player3x = 97 : player3y = 80 : player4x = 76 : player4y = 108 : player5x = 20 : player5y = 220 : _Player5_X_Pos_2 = 20 : _Player5_Y_Pos_2 = 220 : player6x =76 : player6y = 30 : _Player6_X_Pos_2 = 76 : _Player6_Y_Pos_2 = 135 if _level = 18 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 19 then player0x = 21 : player0y = 81 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 10 : _pfExit = 2 : _CountdownSpeed = 12 : _difficulty = 1 : _bulletCount = 4 if _level = 19 then player1x = 42 : player1y = 12 : player2x = 42 : player2y = 152 : player3x = 97 : player3y = 82 : player4x = 111 : player4y = 103 : player5x = 22 : player5y = 43 : _Player5_X_Pos_2 = 22 : _Player5_Y_Pos_2 = 132 : player6x =76 : player6y = 30 : _Player6_X_Pos_2 = 76 : _Player6_Y_Pos_2 = 135 if _level = 19 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _level = 20 then player0x = 21 : player0y = 81 : _Bit5_Flip_P0{5} = 1 : _pfSelection = 10 : _pfExit = 2 : _CountdownSpeed = 10 : _difficulty = 2 : _bulletCount = 4 if _level = 20 then player1x = 42 : player1y = 12 : player2x = 42 : player2y = 152 : player3x = 97 : player3y = 82 : player4x = 111 : player4y = 103 : player5x = 22 : player5y = 43 : _Player5_X_Pos_2 = 22 : _Player5_Y_Pos_2 = 132 : player6x =76 : player6y = 30 : _Player6_X_Pos_2 = 76 : _Player6_Y_Pos_2 = 135 if _level = 20 then _Bit4_Player1_Moves{4} = 1 : _Bit5_Player2_Moves{5} = 1 : _Bit6_Player3_Moves{6} = 1 if _GameFlipped <> 0 then _difficulty = 2 : _bulletCount = 4 if _GameNo = 3 || _GameNo = 6 then _bulletCount = 0 if _GameNo = 2 || _GameNo = 5 then _bulletCount = 6 _NUSIZ1{3} = 0 : NUSIZ2{3} = 0 : NUSIZ3{3} = 0 ; Sets which P1-6 initially face (0=left / 1 = right) NUSIZ4{3} = 0 : NUSIZ5{3} = 0 : NUSIZ6{3} = 0 ;*** Load Playfield Data - 2 columns (pixels) wide & 22 rows (pixels) long if _pfSelection = 1 then playfield: 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 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 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 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 X X X X X X X end if _pfSelection = 2 then playfield: 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 . . . . . . . . . . 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 . . . 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 . . . . . . . . . . . . . . . . . . . . . . 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 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 X X X X X X X X X X X X X X X X X X X X X X end if _pfSelection = 3 then playfield: 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 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 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 . . . . . . . . . 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 . . . . 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 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 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 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 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 X end if _pfSelection = 4 then playfield: 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 . . . . . . 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 . . . 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 . . . . 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 . . . . . . . . . . . . . . . . . . . . . . . . . . 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 end if _pfSelection = 5 then playfield: 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 . . . . . . . . . . . . . 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 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 . . . . . . . . . . . . . . . . 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 end if _pfSelection = 6 then playfield: 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 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 . . . . . . 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 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 . . . 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 X X X X X X X X X X end if _pfSelection = 7 then playfield: 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 . . . . . . . . . . . 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 . . . . . 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 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 . . . . . 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 X X X X X X X X X X X X X X X X X X X X X X end if _pfSelection = 8 then playfield: 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 . . . . . . . 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 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 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 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 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 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 X X X X X X X X X X X end if _pfSelection = 9 then playfield: 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 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 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 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 X X X X X X X X X X end if _pfSelection = 10 then playfield: 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 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 . . . . . . . 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 . . . . . . . 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 X X X X X X X X X X X X X X X X X X X X end scorecolors: $1E $1C $1A $1A $18 $18 $16 $16 end if _Bit5_Flip_P0{5} then REFP0 = 8 ; Sets P0 facing right - defined in level data _Bit1_P1_Moving{1} = 0 : _Bit2_P2_Moving{2} = 0 : _Bit3_P3_Moving{3} = 0 ; P1-3 not moving _Bit0_Money_Captured{0}=0 ; Money (P4) not captured _Bit1_FinalGuardUnleashed{1}=0 goto __Bank_3 bank3 bank 3 temp1=temp1 ;********************************************* ; BEGIN BANK 3 ;********************************************* __Bank_3 __Main_Loop ; *** START OF MAIN LOOP **** if _Bit6_Game_Over{6} then _Ch0_Duration = 1 : _Ch0_Counter = 0 : goto __GameOver bank5 NUSIZ0 = _P0_NUSIZ ; loads data into NUSIZ0 - must be in main loop missile0height = _M0_Height ; set M0 heigth, must be at least 2 - must be in main loop ; missile1height = 2 ; set M1 heigth, must be at least 2 - must be in main loop ; Assign Playfield colors - note: can assign a unique color for every row but we don't if _Bit0_PlayfieldColorSelected{0} then goto __Setup_PF if _level{0} then goto _EvenLevelColors if _GameNo = 1 || _GameNo = 4 then pfcolors: $AA ; row 1 end if _GameNo = 2 || _GameNo = 5 then pfcolors: $7A ; row 1 end if _GameNo = 3 || _GameNo = 6 then pfcolors: $06 ; row 1 end goto __Setup_PF _EvenLevelColors if _GameNo = 1 || _GameNo = 4 then pfcolors: $2E ; row 1 end if _GameNo = 2 || _GameNo = 5 then pfcolors: $CA ; row 1 end if _GameNo = 3 || _GameNo = 6 then pfcolors: $06 ; row 1 end _Bit0_PlayfieldColorSelected{0} = 1 __PauseLoop __Setup_PF ;*** Setup playfield resolution (88 rows, 2 scanlines per row) DF6FRACINC = 0; Background colors. - how many times the background color can be changed in 1 scan (0 means solid background) DF4FRACINC = 0 ; Playfield colors. - how many times the playfield colors can change DF0FRACINC = 32 ; Column 0. DF1FRACINC = 32 ; Column 1. DF2FRACINC = 32 ; Column 2. DF3FRACINC = 32 ; Column 3. drawscreen ; Display the screen ; RESUME HERE if switchbw then _Ch0_Sound = 0 : AUDV0 = 0 : _Ch1_Sound = 0 : AUDV1 = 0 if switchbw then pfcolors: $0E end if switchbw then _Bit0_PlayfieldColorSelected{0} = 0 : goto __PauseLoop ; if switchbw then goto __PauseLoop ; Open playfield doors when P4 captured if !_Bit0_Money_Captured{0} || _Bit7_DoorOpened{7} then goto __Skip_PF_Door if _Bit0_Money_Captured{0} && _pfExit = 1 then pfpixel 0 2 off : pfpixel 0 3 off : pfpixel 0 4 off : _Bit7_DoorOpened{7}=1: __PF_Door_Open if _Bit0_Money_Captured{0} && _pfExit = 2 then pfpixel 0 17 off : pfpixel 0 18 off : pfpixel 0 19 off : _Bit7_DoorOpened{7}=1: __PF_Door_Open if _Bit0_Money_Captured{0} && _pfExit = 3 then pfpixel 31 2 off : pfpixel 31 3 off : pfpixel 31 4 off : _Bit7_DoorOpened{7}=1: __PF_Door_Open if _Bit0_Money_Captured{0} && _pfExit = 4 then pfpixel 31 17 off : pfpixel 31 18 off : pfpixel 31 19 off : _Bit7_DoorOpened{7}=1: __PF_Door_Open if _Bit0_Money_Captured{0} && _pfExit = 5 then pfpixel 14 0 off : pfpixel 15 0 off : pfpixel 16 0 off : _Bit7_DoorOpened{7}=1: __PF_Door_Open if _Bit0_Money_Captured{0} && _pfExit = 6 then pfpixel 14 21 off : pfpixel 15 21 off : pfpixel 16 21 off: _Bit7_DoorOpened{7}=1 __PF_Door_Open __Skip_PF_Door ;*** Setup Game Timer(s) if !_Bit6_Game_Over{6} then _frames=_frames+1 : _moveCounter = _moveCounter + 1 : P1_Counter = P1_Counter + 1 if _frames=15 then _frames=0:_quarterSeconds=_quarterSeconds+1 ; there are generally 60 frams per second if P1_Counter = 6 then P1_Counter = 0 if _moveCounter = 60 then _moveCounter = 0 ;*** Move Triplines if _moveCounter = 1 || _moveCounter = 29 then temp2 = player5y : player5y = _Player5_Y_Pos_2 : _Player5_Y_Pos_2 = temp2 : temp2 = player5x : player5x = _Player5_X_Pos_2 : _Player5_X_Pos_2 = temp2 if _moveCounter = 30 || _moveCounter = 59 then temp2 = player6y : player6y = _Player6_Y_Pos_2 : _Player6_Y_Pos_2 = temp2 : temp2 = player6x : player6x = _Player6_X_Pos_2 : _Player6_X_Pos_2 = temp2 ;***P0 Animation _Bit2_J0_Diag_Up{2} = 0 : _Bit3_J0_Diag_Down{3} = 0 : _Bit4_P0_Not_Moving{4} = 0 if _Bit5_Flip_P0{5} then REFP0 = 8 ; Flips player0 sprite when necessary if _Bit0_J0_Up_Latch{0} && _Bit2_J0_Left_Latch{2} then _Bit2_J0_Diag_Up{2} = 1 if _Bit0_J0_Up_Latch{0} && _Bit3_J0_Right_Latch{3} then _Bit2_J0_Diag_Up{2} = 1 if _Bit1_J0_Down_Latch{1} && _Bit2_J0_Left_Latch{2} then _Bit3_J0_Diag_Down{3} = 1 if _Bit1_J0_Down_Latch{1} && _Bit3_J0_Right_Latch{3} then _Bit3_J0_Diag_Down{3} = 1 if !_Bit0_J0_Up_Latch{0} && !_Bit1_J0_Down_Latch{1} && !_Bit2_J0_Left_Latch{2} && !_Bit3_J0_Right_Latch{3} then _Bit4_P0_Not_Moving{4} = 1 ; STANDING P0 sprite Graphic - P0 sprite with legs together if !_Bit4_P0_Not_Moving{4} then _SkipP0NonMovingLogic player0: %00011000 %00011100 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00011000 %00011000 %00110000 end goto _P0_Animation_Selected _SkipP0NonMovingLogic ;RUNNING Diagonal Up P0 Animation if !_Bit2_J0_Diag_Up{2} then goto _SkipP0UpDiagMovement if _frames = 8 then player0: %00011000 %00011100 %00011000 %00001000 %01001000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames = 1 then player0: ; P0 sprite with legs in running position %00011000 %00011100 %00011000 %00001000 %01001000 %00111000 %00001000 %00001000 %00011000 %00100100 %00100010 end goto _P0_Animation_Selected _SkipP0UpDiagMovement ; RUNNING Diagonal Down P0 Animation if !_Bit3_J0_Diag_Down{3} then _SkipP0DownDiagMovement if _frames = 8 then player0: %00011000 %00011100 %00011000 %00001000 %00001000 %00111000 %01001000 %00001000 %00001000 %00001000 %00001000 end if _frames = 1 then player0: %00011000 %00011100 %00011000 %00001000 %00001000 %00111000 %01001000 %00001000 %00011000 %00100100 %00100010 end goto _P0_Animation_Selected _SkipP0DownDiagMovement ; Left & Right Running Animation (DEFAULT ANIMATION) if _frames = 8 then player0: ; P0 sprite with legs together %00011000 %00011100 %00011000 %00001000 %01101000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames = 1 then player0: ; P0 sprite with legs in running position %00011000 %00011100 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00101000 %00101100 %00100100 end _P0_Animation_Selected ;*** Setup M0 when Fire Button has been pressed (establish initial M0 position and path) if _Bit7_M0_Moving{7} then goto __M0_Setup_Complete; Skip if M0 is already moving if _Bit6_FireOneShot{6} && !_Bit7_M0_Moving{7} then _Bit7_M0_Moving{7} = 1: goto __M0_Start ; Set M0 Moving Flag goto __Skip_M0_Movement __M0_Start ; Takes a 'snapshot' of player0 direction so M0 will stay on track until it hits something. ; _M0_DIR_LATCH ; 0 = NOT MOVING ; 1 = UP ; 2 = DOWN ; 4 = LEFT ; 8 = RIGHT ; 5 = UP & LEFT ; 9 = UP & RIGHT ; 6 = DOWN & LEFT ; 10 = DOWN & RIGHT _Bit4_M0_Flip_P0_Latch{4} = _Bit5_Flip_P0{5} if !switchleftb then _M0_Dir_Latch = _shootDir else _M0_Dir_Latch = s & %00001111 ; Set starting position of M0. _Ch0_Sound = 1 : _Ch0_Duration = 1 : _Ch0_Counter = 0 if !_Bit4_M0_Flip_P0_Latch{4} && _M0_Dir_Latch = 1 then missile0x=player0x+3 : missile0y=player0y : __M0_Setup_Complete ; facing left - shooting up if !_Bit4_M0_Flip_P0_Latch{4} && _M0_Dir_Latch = 2 then missile0x=player0x+3 : missile0y=player0y : __M0_Setup_Complete ; facing left - shooting down if _Bit4_M0_Flip_P0_Latch{4} && _M0_Dir_Latch = 1 then missile0x=player0x+6 : missile0y=player0y : __M0_Setup_Complete ; facing right - shooting up if _Bit4_M0_Flip_P0_Latch{4} && _M0_Dir_Latch = 2 then missile0x=player0x+6 : missile0y=player0y : __M0_Setup_Complete ; facing right - shooting down if !_Bit4_M0_Flip_P0_Latch{4} then missile0x = player0x + 2 : missile0y = player0y+3 ; facing right - default if _Bit4_M0_Flip_P0_Latch{4} then missile0x = player0x + 7 : missile0y = player0y+3 ; facing left - default __M0_Setup_Complete ;*** Move M0 ; Note: _M0_Width doesn't actually control width but is set in order to assist with collision detection. Width is really controlled by P0_NUSIZ ; Note: _M0_Height does control heigth ; if _frames{0} then __M0_Move_Complete if !_Bit7_M0_Moving{7} then goto __Skip_M0_Movement ; Skip if M0 not moving if _M0_Dir_Latch = 1 then _P0_NUSIZ = $00 : _M0_Height = 4 : _M0_Width = 1 : missile0y = missile0y - 4 ; shoot up if _M0_Dir_Latch = 2 then _P0_NUSIZ = $00 : _M0_Height = 4 : _M0_Width = 1 : missile0y = missile0y + 4 ; shoot down if _M0_Dir_Latch = 4 then _P0_NUSIZ = $20 : _M0_Height = 2 : _M0_Width = 4 : missile0x = missile0x - 2 ; shoot left if _M0_Dir_Latch = 8 then _P0_NUSIZ = $20 : _M0_Height = 2 : _M0_Width = 4 : missile0x = missile0x + 2 ; shoot right if _M0_Dir_Latch = 5 then _P0_NUSIZ = $10 : _M0_Height = 2 : _M0_Width = 2 : missile0x = missile0x - 2 : missile0y = missile0y -2 ; shoot up and left if _M0_Dir_Latch = 9 then _P0_NUSIZ = $10 : _M0_Height = 2 : _M0_Width = 2 : missile0x = missile0x +2 : missile0y = missile0y -2 ; shoot up and right if _M0_Dir_Latch = 6 then _P0_NUSIZ = $10 : _M0_Height = 2 : _M0_Width = 2 : missile0x = missile0x -2 : missile0y = missile0y +2 ; shoot down and left if _M0_Dir_Latch = 10 then _P0_NUSIZ = $10 : _M0_Height = 2 : _M0_Width = 2 : missile0x = missile0x +2 : missile0y = missile0y +2 ; shoot down and right if switchleftb && _M0_Dir_Latch = 0 && !_Bit4_M0_Flip_P0_Latch{4} then _P0_NUSIZ = $20 : _M0_Height = 2 : _M0_Width = 4 : missile0x = missile0x - 2 ; not moving - shoot left if switchleftb && _M0_Dir_Latch = 0 && _Bit4_M0_Flip_P0_Latch{4} then _P0_NUSIZ = $20 : _M0_Height = 2 : _M0_Width = 14: missile0x = missile0x + 2 ; not moving - shoot right __M0_Move_Complete ;*** Move M0 off screen if it hits playfield if _frames{0} then goto __Skip_M0_Movement if _Bit4_M0_Flip_P0_Latch{4} then temp3 = (missile0x-16)/4 ; 24->20 if !_Bit4_M0_Flip_P0_Latch{4} && missile0x>16 then temp3 = (missile0x-16)/4 if !_Bit4_M0_Flip_P0_Latch{4} && missile0x<17 then temp3 = 0 ; avoids a math error if missile - 16 goes negative temp4 = missile0y/8 if pfread(temp3,temp4) then _Bit7_M0_Moving{7} = 0 : missile0x = 20 : missile0y = 220 : goto __Skip_Collision_Checks ; # ; temp5 = temp3 + 1 ; if pfread(temp5,temp4) then _Bit7_M0_Moving{7} = 0 : missile0x = 20 : missile0y = 220 : goto __Skip_Collision_Checks ; # __Skip_M0_Movement ;*** Collision Checks ;*** Checks for M0 collision with other 9 sprites, 10 is used for the y check because these sprites are 11 ; Money Captured ; release door protecting guard if _frames{1} then __SkipMoneyMonitoring if !_Bit0_Money_Captured{0} &&(player0y + 10) >= player4y && player0y <= (player4y + 10) && (player0x + 7) >= player4x && player0x <= (player4x + 7) then _Bit0_Money_Captured{0}=1 :_difficulty=_difficulty+1 if _GameNo = 3 || _GameNo = 6 then _difficulty = 1 : __SkipFinalGuard __SkipMoneyMonitoring if _Bit0_Money_Captured{0} && !_Bit1_FinalGuardUnleashed{1} && player1y>200 then temp4=_pfExit+_pfExit : player1x=_finalGuard[temp4] : temp4=temp4+1 : player1y = _finalGuard[temp4] :_Bit4_Player1_Moves{4} = 1 : _Bit1_FinalGuardUnleashed{1} = 1 : __SkipFinalGuard ; # if _Bit0_Money_Captured{0} && !_Bit1_FinalGuardUnleashed{1} && player2y>200 then temp4=_pfExit+_pfExit : player2x=_finalGuard[temp4] : temp4=temp4+1 : player2y = _finalGuard[temp4] :_Bit5_Player2_Moves{5} = 1 : _Bit1_FinalGuardUnleashed{1} = 1 : __SkipFinalGuard ; # if _Bit0_Money_Captured{0} && !_Bit1_FinalGuardUnleashed{1} && player3y>200 then temp4=_pfExit+_pfExit : player3x=_finalGuard[temp4] : temp4=temp4+1 : player3y = _finalGuard[temp4] :_Bit6_Player3_Moves{6} = 1 : _Bit1_FinalGuardUnleashed{1} = 1 : __SkipFinalGuard ; # __SkipFinalGuard if player4y<200 && _Bit0_Money_Captured{0} then player4x = 20 : player4y = 220 : score = score + 1000 : _Ch0_Sound = 2 : _Ch0_Duration = 1 : _Ch0_Counter = 0 : goto __Skip_Collision_Checks ; # data _finalGuard ; Starting position of guard that comes through exit door - ignore first 0 0 pair - x y pairs 0 0 17 23 17 143 128 23 128 143 74 12 74 162 end if collision(player0, player1) then _Bit6_Game_Over{6} = 1 : _Ch0_Duration = 1 : _Ch0_Counter = 0 : goto __Skip_Collision_Checks; detect if P0 is hit by one of the P1s (robber caught by cop) - makes the colors stream __M0_Collision if !collision(player1,missile0) then goto __Skip_M0_Collision temp5 = _M0_Width ; missile width temp6 = _M0_Height ; missile height if (missile0y + temp6) >= player1y && missile0y <= (player1y + 10) && (missile0x + temp5) >= player1x && missile0x <= (player1x + 7) then player1x = 20 : player1y = 220 if (missile0y + temp6) >= player2y && missile0y <= (player2y + 10) && (missile0x + temp5) >= player2x && missile0x <= (player2x + 7) then player2x = 20 : player2y = 220 if (missile0y + temp6) >= player3y && missile0y <= (player3y + 10) && (missile0x + temp5) >= player3x && missile0x <= (player3x + 7) then player3x = 20 : player3y = 220 _Bit7_M0_Moving{7} = 0 missile0x = 20 missile0y = 220 __Skip_M0_Collision ; Checks for player0 exiting door (robber escapes through door) if player0x <18 || player0x > 135 then player0x = 20 : player0y = 220 : goto __levelComplete bank2; X 19-133 if player0y <6 || player0y >160 then player0x = 20 : player0y = 220 : goto __levelComplete bank2; Y ranges 6-159 __Skip_Collision_Checks ;*** Monitor Joystick and Move P0 if _Bit6_Game_Over{6} then goto __Skip_JoyStick_Monitoring ; stop the movement of player0 if game is over if _Bit5_Flip_P0{5} && _quarterSeconds < 2 then goto __Cant_Move_Left ; keeps player from accidentally turning to face left a begining of level ; Joy LEFT Control __J0_Left if !joy0left then __Cant_Move_Left ; # temp5 = (player0x-17)/4 temp6 = (player0y)/8 if pfread(temp5,temp6) then __Cant_Move_Left ; # temp3 = temp6+1 if pfread(temp5,temp3) then __Cant_Move_Left ; # _Bit5_Flip_P0{5} = 0 _Bit2_J0_Left_Latch{2} = 1 player0x=player0x-1 goto __J0_Up __Cant_Move_Left _Bit2_J0_Left_Latch{2} = 0 ; Joy UP Control __J0_Up if !joy0up then __Cant_Move_Up ; # temp3 = (player0x-16)/4 temp4 = ((player0y-2)/8) if pfread(temp3,temp4) then __Cant_Move_Up ; # temp5 = temp3 + 1 if pfread(temp5,temp4) then __Cant_Move_Up ; # _Bit0_J0_Up_Latch{0} = 1 player0y=player0y-1 goto __J0_Down __Cant_Move_Up _Bit0_J0_Up_Latch{0} = 0 ; Joy DOWN Control __J0_Down if !joy0down then __Cant_Move_Down ; # temp3 = (player0x-16)/4 temp4 = ((player0y+12)/8) if pfread(temp3,temp4) then __Cant_Move_Down ; # temp5 = temp3 + 1 if pfread(temp5,temp4) then __Cant_Move_Down ; # _Bit1_J0_Down_Latch{1} = 1 player0y=player0y+1 goto __J0_Right __Cant_Move_Down _Bit1_J0_Down_Latch{1} = 0 ; Joy RIGHT Control __J0_Right if !joy0right then __Cant_Move_Right ; # temp5 = ((player0x-8)/4) temp6 = ((player0y)/8) if pfread(temp5,temp6) then __Cant_Move_Right ; # temp3 = temp6+1 if pfread(temp5,temp3) then __Cant_Move_Right ; # _Bit5_Flip_P0{5} = 1 _Bit3_J0_Right_Latch{3} = 1 player0x=player0x+1 goto __J0_Fire __Cant_Move_Right _Bit3_J0_Right_Latch{3} = 0 __J0_Fire if _GameNo=3 || _GameNo=6 then __Skip_J0_Fire if _quarterSeconds < 1 then __Skip_J0_Fire ; # keeps player from accidentally firing at start of level if joy0fire && !_Bit5_Transition_Latch{5} then _Bit6_FireOneShot{6} = 1: _Bit5_Transition_Latch{5} = 1 else _Bit6_FireOneShot{6} = 0 : _Bit5_Transition_Latch{5} = 0 if _Bit6_FireOneShot{6} && _bulletCount<>0 then _bulletCount = _bulletCount - 1 else _Bit6_FireOneShot{6} = 0 if _GameNo = 2 || _GameNo=5 then _bulletCount = 6 if joy0fire then _Bit5_Transition_Latch{5} = 1 __Skip_J0_Fire __Skip_JoyStick_Monitoring temp4 = s & %00001111 if temp4 > 0 then _shootDir = temp4 /* ;*************************************************************** ; ; Puts temp4 in the three score digits on the left side. - Used for Debugging - can cause scan count to go over 262 ; temp4 = _Lives _sc1 = 0 : _sc2 = _sc2 & 15 if temp4 >= 100 then _sc1 = _sc1 + 16 : temp4 = temp4 - 100 if temp4 >= 100 then _sc1 = _sc1 + 16 : temp4 = temp4 - 100 if temp4 >= 50 then _sc1 = _sc1 + 5 : temp4 = temp4 - 50 if temp4 >= 30 then _sc1 = _sc1 + 3 : temp4 = temp4 - 30 if temp4 >= 20 then _sc1 = _sc1 + 2 : temp4 = temp4 - 20 if temp4 >= 10 then _sc1 = _sc1 + 1 : temp4 = temp4 - 10 _sc2 = (temp4 * 4 * 4) | _sc2 ;*************************************************************** ; ; Puts temp4 in the three score digits on the right side. - Used for Debugging ; temp4 = 0 _sc2 = _sc2 & 240 : _sc3 = 0 if temp4 >= 100 then _sc2 = _sc2 + 1 : temp4 = temp4 - 100 if temp4 >= 100 then _sc2 = _sc2 + 1 : temp4 = temp4 - 100 if temp4 >= 50 then _sc3 = _sc3 + 80 : temp4 = temp4 - 50 if temp4 >= 30 then _sc3 = _sc3 + 48 : temp4 = temp4 - 30 if temp4 >= 20 then _sc3 = _sc3 + 32 : temp4 = temp4 - 20 if temp4 >= 10 then _sc3 = _sc3 + 16 : temp4 = temp4 - 10 _sc3 = _sc3 | temp4 */ goto __Bank_4 bank4 ;********************************************* ; BEGIN BANK 4 ;********************************************* bank 4 temp1=temp1 __Bank_4 ;*** P1-P3 control (AI) ; if !_moveCounter{0} then goto __skip_Player5_Movement bank4 ; Skips all P1 Motion AI if frame is even (to keep scan lines down) ; Move P1s towards P0 - won't move sprite if it is off screen (i.e., player#y>200) ; Valid X ranges 19-133 & Y ranges 6-159 ; P1 ; _Bit1_P1_Moving{1} = 0 if !_Bit4_Player1_Moves{4} || player1y>200 then goto __skip_Player1_Movement if P1_Counter <> 1 then goto __skip_Player1_Movement ; Define box around P1 - if P0 enters this box then move P1 if player1x<40 then temp2=10 else temp2 = player1x-40 if player1x>93 then temp3=133 else temp3 = player1x+40 if player1y<47 then temp4=7 else temp4 = player1y-40 if player1y>119 then temp5=160 else temp5 = player1y+40 if _Bit1_P1_Moving{1} then __move_Player1 ; # if _Bit0_Money_Captured{0} && player1y < 200 then __move_Player1 ; # If money is captured start moving P1 if player0x >temp2 && player0xtemp4 && player0yplayer0x then _NUSIZ1{3} = 0 _Bit1_P1_Moving{1} = 1 ; P1 UP Control if player1yplayer0y then goto __P1Cant_Move_Down; P1 below P0 temp3 = (player1x-16)/4 temp4 = ((player1y+12)/8) if pfread(temp3,temp4) then __P1Cant_Move_Down temp5 = temp3 + 1 if pfread(temp5,temp4) then __P1Cant_Move_Down if _difficulty = 1 then player1y = player1y + 1 if _difficulty = 2 then player1y = player1y + 2 if _difficulty = 3 then player1y = player1y + 3 __P1Cant_Move_Down ; P1 LEFT Control if _NUSIZ1{3} || player1xplayer0x then goto __P1Cant_Move_Right; P1 to the right of P0 temp5 = ((player1x-8)/4) temp6 = ((player1y)/8) if pfread(temp5,temp6) then __P1Cant_Move_Right temp3 = temp6+1 if pfread(temp5,temp3) then __P1Cant_Move_Right if _difficulty = 1 then player1x = player1x + 1 if _difficulty = 2 then player1x = player1x + 2 if _difficulty = 3 then player1x = player1x + 3 __P1Cant_Move_Right __skip_Player1_Movement ; P2 if !_Bit5_Player2_Moves{5} || player2y>200 then goto __skip_Player2_Movement if P1_Counter<>2 then goto __skip_Player2_Movement if player2x<40 then temp2=10 else temp2 = player2x-40 if player2x>93 then temp3=133 else temp3 = player2x+40 if player2y<47 then temp4=7 else temp4 = player2y-40 if player2y>119 then temp5=160 else temp5 = player2y+40 if _Bit2_P2_Moving{2} then __move_Player2 if _Bit0_Money_Captured{0} && player2y < 200 then __move_Player2 if player0x >temp2 && player0xtemp4 && player0yplayer0x then NUSIZ2{3} = 0 _Bit2_P2_Moving{2} = 1 ; P2 UP Control if player2yplayer0y then goto __P2Cant_Move_Down; P2 below P0 temp3 = (player2x-16)/4 temp4 = ((player2y+12)/8) if pfread(temp3,temp4) then __P2Cant_Move_Down temp5 = temp3 + 1 if pfread(temp5,temp4) then __P2Cant_Move_Down if _difficulty = 1 then player2y = player2y + 1 if _difficulty = 2 then player2y = player2y + 2 if _difficulty = 3 then player2y = player2y + 3 __P2Cant_Move_Down ; P2 LEFT Control if NUSIZ2{3} || player2xplayer0x then goto __P2Cant_Move_Right; P2 to the right of P0 temp5 = ((player2x-8)/4) temp6 = ((player2y)/8) if pfread(temp5,temp6) then __P2Cant_Move_Right temp3 = temp6+1 if pfread(temp5,temp3) then __P2Cant_Move_Right if _difficulty = 1 then player2x = player2x + 1 if _difficulty = 2 then player2x = player2x + 2 if _difficulty = 3 then player2x = player2x + 3 __P2Cant_Move_Right __skip_Player2_Movement ; P3 if !_Bit6_Player3_Moves{6} || player3y>200 then goto __skip_Player3_Movement if P1_Counter<>3 then goto __skip_Player3_Movement if player3x<40 then temp2=10 else temp2 = player3x-40 if player3x>93 then temp3=133 else temp3 = player3x+40 if player3y<47 then temp4=7 else temp4 = player3y-40 if player3y>119 then temp5=160 else temp5 = player3y+40 if _Bit3_P3_Moving{3} then __move_Player3 if _Bit0_Money_Captured{0} && player3y < 200 then __move_Player3 if player0x >temp2 && player0xtemp4 && player0yplayer0x then NUSIZ3{3} = 0 _Bit3_P3_Moving{3} = 1 ; P3 UP Control if player3yplayer0y then goto __P3Cant_Move_Down; P3 below P0 temp3 = (player3x-16)/4 temp4 = ((player3y+12)/8) if pfread(temp3,temp4) then __P3Cant_Move_Down temp5 = temp3 + 1 if pfread(temp5,temp4) then __P3Cant_Move_Down if _difficulty = 1 then player3y = player3y + 1 if _difficulty = 2 then player3y = player3y + 2 if _difficulty = 3 then player3y = player3y + 3 __P3Cant_Move_Down ; P3 LEFT Control if NUSIZ3{3} || player3xplayer0x then goto __P3Cant_Move_Right; P3 to the right of P0 temp5 = ((player3x-8)/4) temp6 = ((player3y)/8) if pfread(temp5,temp6) then __P3Cant_Move_Right temp3 = temp6+1 if pfread(temp5,temp3) then __P3Cant_Move_Right if _difficulty = 1 then player3x = player3x + 1 if _difficulty = 2 then player3x = player3x + 2 if _difficulty = 3 then player3x = player3x + 3 __P3Cant_Move_Right __skip_Player3_Movement if !_Bit1_P1_Moving{1} then goto __No_P1_Animation ; Left & Right Running Animation (DEFAULT ANIMATION) if _frames = 9 then player1: ; P0 sprite with legs together %00011000 %00111000 %00011000 %01100000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames =2 then player1: ; P0 sprite with legs in running position %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00101000 %00101100 %00100100 end goto __P2_Animation __No_P1_Animation player1: %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00011000 %00011000 %00110000 end __P2_Animation if !_Bit2_P2_Moving{2} then goto __No_P2_Animation ; Left & Right Running Animation (DEFAULT ANIMATION) if _frames = 9 then player2: ; P2 sprite with legs together %00011000 %00111000 %00011000 %01100000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames =2 then player2: ; P2 sprite with legs in running position %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00101000 %00101100 %00100100 end goto __P3_Animation __No_P2_Animation player2: %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00011000 %00011000 %00110000 end __P3_Animation if !_Bit3_P3_Moving{3} then goto __No_P3_Animation ; Left & Right Running Animation (DEFAULT ANIMATION) if _frames = 10 then player3: ; P3 sprite with legs together %00011000 %00111000 %00011000 %01100000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames =3 then player3: ; P3 sprite with legs in running position %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00101000 %00101100 %00100100 end goto __P1Animation_Complete __No_P3_Animation player3: %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00011000 %00011000 %00110000 end __P1Animation_Complete ;*** Display Timer Bar if _frames <> 7 then goto __SkipLivesBar if _GameNo <> 1 && _GameNo <> 4 then goto __skip_TimerBar if _quarterSeconds < _CountdownSpeed then pfscorecolor = $C6 : pfscore2 = %11111111 if _quarterSeconds = _CountdownSpeed then pfscore2 = %01111111 if _quarterSeconds = _CountdownSpeed * 2 then pfscore2 = %00111111 : __BulletDisplay if _quarterSeconds = _CountdownSpeed * 3 then pfscore2 = %00011111 : __BulletDisplay if _quarterSeconds = _CountdownSpeed * 4 then pfscorecolor = $1E : pfscore2 = %00001111 : __BulletDisplay if _quarterSeconds = _CountdownSpeed * 5 then pfscore2 = %00000111 : _Ch1_Sound = 1 : _Ch1_Duration = 1 : _Ch1_Counter = 0 : __BulletDisplay if _quarterSeconds = _CountdownSpeed * 6 then pfscorecolor = $34 : pfscore2 = %00000011 : _Ch1_Sound = 1 : _Ch1_Duration = 1 : _Ch1_Counter = 0 : __BulletDisplay if _quarterSeconds = _CountdownSpeed * 7 then pfscore2 = %00000001 : _Ch1_Sound = 1 : _Ch1_Duration = 1 : _Ch1_Counter = 0 : __BulletDisplay if _quarterSeconds = _CountdownSpeed * 8 then pfscore2 = %00000000 : _Bit6_Game_Over{6} = 1 __BulletDisplay if _bulletCount = 0 then pfscore1 = %00000000 if _bulletCount = 1 then pfscore1 = %10000000 if _bulletCount = 2 then pfscore1 = %11000000 if _bulletCount = 3 then pfscore1 = %11100000 if _bulletCount = 4 then pfscore1 = %11100100 if _bulletCount = 5 then pfscore1 = %11100110 if _bulletCount = 6 then pfscore1 = %11100111 goto __SkipLivesBar __skip_TimerBar pfscorecolor = $0A if _Lives = 3 then pfscore1 = %00010101 if _Lives = 2 then pfscore1 = %00000101 if _Lives = 1 then pfscore1 = %00000001 __SkipLivesBar ;*** Channel 0 Sounds ; 1 = Gunshot ; 2 = Pickup Money/Loot ;*** Channel 1 Sounds ; 1 = Time running low __PlaySound ;*** CHANNEL 0 if !_Ch0_Sound then goto __Skip_Ch_0 ; Skips all channel 0 sounds if sounds are off. _Ch0_Duration = _Ch0_Duration - 1 ; Decreases the channel 0 duration counter. if _Ch0_Duration then goto __Skip_Ch_0 ; Skips all channel 0 sounds if duration; counter is greater than zero ;*** CHANNEL 0 - SOUND 1 if _Ch0_Sound <> 1 then goto __Skip_Ch0_Sound_001 ; Skips this section if sound 001 isn't on. temp4 = _CH0_SD1[_Ch0_Counter] ; Retrieves first part of channel 0 data. if temp4 = 255 then goto __Clear_Ch_0 ; Checks for end of data. _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. temp5 = _CH0_SD1[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. temp6 = _CH0_SD1[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. AUDV0 = temp4 ; Plays channel 0. AUDC0 = temp5 ; Plays channel 0. AUDF0 = temp6 ; Plays channel 0. _Ch0_Duration = _CH0_SD1[_Ch0_Counter] ; Sets Duration. _Ch0_Counter = _Ch0_Counter + 1 ; increment data counter goto __Skip_Ch_0 ; Jumps to end of channel 0 area. __Skip_Ch0_Sound_001 ;*** END OF SOUND 1 ;*** CHANNEL 0 - SOUND 2 if _Ch0_Sound <> 2 then goto __Skip_Ch0_Sound_002 ; Skips this section if sound 002 isn't on. temp4 = _CH0_SD2[_Ch0_Counter] ; Retrieves first part of channel 0 data. if temp4 = 255 then goto __Clear_Ch_0 ; Checks for end of data. _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. temp5 = _CH0_SD2[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. temp6 = _CH0_SD2[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. AUDV0 = temp4 ; Plays channel 0. AUDC0 = temp5 ; Plays channel 0. AUDF0 = temp6 ; Plays channel 0. _Ch0_Duration = _CH0_SD2[_Ch0_Counter] ; Sets Duration. _Ch0_Counter = _Ch0_Counter + 1 ; increment data counter goto __Skip_Ch_0 ; Jumps to end of channel 0 area. __Skip_Ch0_Sound_002 ;*** END OF SOUND 2 ; ADDITIONAL CH0 SOUND EFFECTS GO HERE goto __Skip_Ch_0 ; Jumps to end of channel 0 area. (This catches any mistakes.) __Clear_Ch_0 _Ch0_Sound = 0 : AUDV0 = 0 ; ; Clears channel 0. __Skip_Ch_0 ; End of channel 0 area. ;*** CHANNEL 1 if !_Ch1_Sound then goto __Skip_Ch_1 ; Skips all channel 1 sounds if sounds are off. _Ch1_Duration = _Ch1_Duration - 1 ; Decreases the channel 1 duration counter. if _Ch1_Duration then goto __Skip_Ch_1 ; ; Skips all channel 1 sounds if duration counter is greater than zero. ;*** CHANNEL 1 - SOUND 1 if _Ch1_Sound <> 1 then goto __Skip_Chan1_Sound_001 ; Skips this section if sound 001 isn't on. temp4 = _CH1_SD1[_Ch1_Counter] ; Retrieves first part of channel 1 data. if temp4 = 255 then goto __Clear_Ch_1 ; Checks for end of data. _Ch1_Counter = _Ch1_Counter + 1 ; Retrieves more channel 1 data. temp5 = _CH1_SD1[_Ch1_Counter] : _Ch1_Counter = _Ch1_Counter + 1 ; Retrieves more channel 1 data. temp6 = _CH1_SD1[_Ch1_Counter] : _Ch1_Counter = _Ch1_Counter + 1 ; Retrieves more channel 1 data. AUDV1 = temp4 ; Plays channel 1. AUDC1 = temp5 ; Plays channel 1. AUDF1 = temp6 ; Plays channel 1. _Ch1_Duration = _CH1_SD1[_Ch1_Counter] ; Sets duration. _Ch1_Counter = _Ch1_Counter + 1 ; increments data counter goto __Skip_Ch_1 ; Jumps to end of channel 1 area. __Skip_Chan1_Sound_001 ; ADDITIONAL CH1 SOUND EFFECTS GO HERE goto __Skip_Ch_1 ; Jumps to end of channel 1 area. (This catches any mistakes.) __Clear_Ch_1 _Ch1_Sound = 0 : AUDV1 = 0 ; Clears channel 1. __Skip_Ch_1 ; ; End of channel 1 area. ; goto __Bank_3 bank3 goto __Reset_Logic ; Vol Control Freq (lower numbers are higher freq and vice-a-versa) ; Duration data _CH0_SD1 5,8,12 1 4,8,12 1 3,8,12 1 2,8,12 1 1,8,12 1 0,8,12 1 255 end data _CH0_SD2 6,12,12 20 6,12,17 20 6,12,12 20 6,12,17 20 6,12,12 20 6,12,17 20 255 end data _CH1_SD1 8,4,17 1 8,4,25 1 8,4,17 1 8,4,25 1 8,4,17 1 8,4,25 1 255 end __Reset_Logic if switchreset then _level = 254 : goto __Start_Restart bank2 goto __Main_Loop bank3 ;********************************************* ; BEGIN BANK 5 ;********************************************* bank 5 temp1=temp1 __Bank_5 __GameOver _frames = 0 _quarterSeconds = 0 _GameFlipped = 0 __GameOverLoop ;*** GAME OVER PLAYER EFFECT - MULTICOLORED FLASHING player0color = player0color+10 _frames=_frames+1 if _frames=120 then _quarterSeconds = 8 : _frames = 1 ;*** CHANNEL 0 - GAMEOVER SOUND _Ch0_Duration = _Ch0_Duration - 1 ; Decreases the channel 0 duration counter. if _Ch0_Duration then goto __Skip_GAMEOVER_SOUND temp4 = _CH0_GAMEOVER[_Ch0_Counter] ; Retrieves first part of channel 0 data. if temp4 = 255 then goto __Clear_GAMEOVER_SOUND ; Checks for end of data. _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. temp5 = _CH0_GAMEOVER[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. temp6 = _CH0_GAMEOVER[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 ; Retrieves more channel 0 data. AUDV0 = temp4 ; Plays channel 0. AUDC0 = temp5 ; Plays channel 0. AUDF0 = temp6 ; Plays channel 0. _Ch0_Duration = _CH0_GAMEOVER[_Ch0_Counter] ; Sets Duration. _Ch0_Counter = _Ch0_Counter + 1 ; increment data counter goto __Skip_GAMEOVER_SOUND ; Jumps to end of channel 0 area. __Clear_GAMEOVER_SOUND _Ch0_Sound = 0 : AUDV0 = 0 ; Clears channel 0. __Skip_GAMEOVER_SOUND ;*** GAME OVER PLAYFIELD HANDLING DF6FRACINC = 0; Background colors. - how many times the background color can be changed in 1 scan (0 means solid background) DF4FRACINC = 0 ; Playfield colors. - how many times the playfield colors can change DF0FRACINC = 32 ; Column 0. DF1FRACINC = 32 ; Column 1. DF2FRACINC = 32 ; Column 2. DF3FRACINC = 32 ; Column 3. drawscreen ; _Bit5_Flip_P0{5} = 1 if switchreset then _level = 0 : _GameFlipped = 0 : goto __Start_Restart bank2 ;*** START NEW GAME ON FIRE BUTTON ; Show remaining lives left if _GameNo=4 then __SkipLivesDisplay pfscorecolor = $0A pfscore2 = %00000000 if _Lives = 3 then pfscore1 = %00000101 if _Lives = 2 then pfscore1 = %00000001 if _Lives = 1 then pfscore1 = %00000000 if _quarterSeconds<8 then goto __GameOverLoop if _Bit0_Money_Captured{0} && _Lives > 1 then score=score-1000 : _Bit0_Money_Captured{0} = 0 __SkipLivesDisplay if _quarterSeconds<8 then goto __GameOverLoop if _Lives = 1 && joy0fire && _GameNo<4 then _Lives = 3 :_level = 255 : _GameFlipped = 0 : goto __Start_Restart bank2 ; NEED TO WAIT UNTILL SOUND OVER THEN PRESS FIRE TO START NEW GAME if _Lives = 1 && joy0fire && _GameNo>3 then _Lives = 1 :_level = 255 : _GameFlipped = 0 : goto __Start_Restart bank2 if _GameNo = 3 && _Lives > 1 then _level=_level-2 : _Lives=_Lives-1: _GameFlipped = 0 : goto __PlayNextLife bank2 if _GameNo <> 3 && _Lives > 1 then _level=_level-1 : _Lives=_Lives-1: _GameFlipped = 0 : goto __PlayNextLife bank2 goto __GameOverLoop data _CH0_GAMEOVER 6,12,22 15 6,12,25 15 6,12,28 15 6,12,25 15 6,12,28 15 255 end ;********************************************* ; BEGIN BANK 6 ;********************************************* bank 6 temp1=temp1 __Bank_6 __TitleScreen ;*** Setup playfield resolution (88 rows, 2 scanlines per row) const anim_delay = 40 ; 1 unit = 1 quarter seconds const anim_P1P0Y = 108 ; P0 and P1 will run at this Y value const anim_startX = 12 ; start P0 and P1 at this X value const anim_endX=134 ; X value at end of run const anim_startP1whenP0atX = 60 ; wait to start P1 until P0 at this X value const anim_P1P0gap = 10 ; gap between P0 and P1 once P1 cathes up to P0 const anim_offScreenX = 20 ; where to park sprites off screen const anim_offScreenY = 220 ; where to park sprites off screen _GameFlipped = 0 _frames = 0 score = 1 _GameNo = 1 pfscore1 = %00000000 pfscore2 = %00000000 player0x = anim_startX : player0y=anim_P1P0Y player1x = anim_startX : player1y=anim_offScreenY player2x = anim_offScreenX : player2y=anim_offScreenY player3x = anim_offScreenX : player3y=anim_offScreenY player4x = anim_offScreenX : player4y=anim_offScreenY player5x = anim_offScreenX : player5y=anim_offScreenY player6x = anim_offScreenX : player6y=anim_offScreenY __DisplayTitleScreen ; Playfield data - 32 columns (pixels) wide & 88 rows (pixels) long playfield: ................................ ; row 1 ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ; row 10 ................................ .....................X.......... .....................X.......... .....................X.......... X...X...XXXX...X....XXXX...XXXXX ; row 15 X...X...XXXX...X....XXXX...XXXXX X...X...XXXX...X....XXXX...XXXXX X...X...X......X...X.X.......X.. X...X...X......X...X.X.......X.. X...X...X......X...X.X.......X.. ; row 20 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.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.. ; row 30 XXXXX...XXXX...X....XXX......X.. XXXXX...XXXX...X....XXX......X.. XXXXX...XXXX...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......X.....X.X.....X.. X...X...X......X.....X.X.....X.. X...X...X......X.....X.X.....X.. .; row 40 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.X.....X.. X...X...X......X.....X.X.....X.. X...X...XXXX...X...XXXX......X.. X...X...XXXX...X...XXXX......X.. X...X...XXXX...X...XXXX......X.. ; row 50 .....................X.......... .....................X.......... .....................X.......... ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. XXXXXXXXXXXXX.....XXXXXXXXXXXXX. XXXXXXXXXXXX.......XXXXXXXXXXXX.; row 61 XXXXXXXXXXXX.......XXXXXXXXXXXX. XXXXXXXXXXXX.......XXXXXXXXXXXX. XXXXXXXXXXXXX.....XXXXXXXXXXXXX. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. ................................ ................................ ................................ ................................ ................................ ; row 71 ................................ ................................ ......XXX.XXX.XXX.XXX.XXX....... ......X.X.X.X.X...X...X......... ......XXX.XXX.XXX.XXX.XXX....... ......X...XX..X.....X...X....... ......X...X.X.XXX.XXX.XXX....... ................................ ................................ ................................; row 81 ........XXX.X.XXX.XXX.X......... ........X...X.X.X.X...X......... ........XXX.X.XXX.XXX.X......... ........X...X.XX..X............. ........X...X.X.X.XXX.X......... ................................ ................................ ................................ ; row 88 end ; Playfield colors. 1 for each of the 88 pf rows/lines pfcolors: $2E ; row 1 $26 $2E $28 $26 $2E $2C $2A $28 $26 ; row 10 $2E $2C $2A $28 $26 $2E $2C $2A $28 $26 ; row 20 $2E $2C $2A $28 $26 $2E $2C $2A $28 $26 ; row 30 $2E $2C $2A $28 $26 $2E $2C $2A $28 $26 ; row 40 $2E $2C $2A $28 $26 $2E $2C $2A $28 $26 ; row 50 $2E $2C $2A $28 $26 $2E $C6 $C6 $C6 $C6 ; row 60 $C6 $C6 $C6 $C6 $C6 $C6 $C6 $C6 $C6 $C6 ; row 70 $C6 $1C $1C $1C $1C $1C $1C $1C $1C $34 ; row 80 $34 $34 $34 $34 $34 $34 $34 $34 ; row 88 end scorecolors: $0E $0E $0E $0E $0E $0E $0E $0E end ; Playfield Aimation REFP0 = 8 _NUSIZ1{3} = 1 _frames = _frames+1 if _frames = 15 then _frames = 1 : _quarterSeconds = _quarterSeconds +1 if _quarterSeconds >= anim_delay then _quarterSeconds = 0 : temp2=temp2+1 if temp2>250 then temp2=1 if _frames{0} && player0yanim_endX then player0x=anim_startP1whenP0atX : player0y=anim_offScreenY temp3 = player0x-anim_P1P0gap if player0xanim_startP1whenP0atX then player1y=anim_P1P0Y if player0yanim_startP1whenP0atX && player1x>=temp3 then player1x=player0x-anim_P1P0gap if player1yanim_startP1whenP0atX && player1x=anim_endX && player1y250 then temp5=2 if temp2 = temp5 then player0x = anim_startX : player0y=anim_P1P0Y : player1x = anim_startX : player1y=anim_offScreenY if _frames = 9 then player0: ; P0 sprite with legs together %00011000 %00111000 %00011000 %00001000 %01101000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames =2 then player0: ; P0 sprite with legs in running position %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00101000 %00101100 %00100100 end if _frames = 10 then player1: ; P1 sprite with legs together %00011000 %00111000 %00011000 %00001000 %01101000 %00111000 %00001000 %00001000 %00001000 %00001000 %00001000 end if _frames =3 then player1: ; P1 sprite with legs in running position %00011000 %00111000 %00011000 %11000000 %01110000 %00011000 %00011000 %00011000 %00101000 %00101100 %00100100 end ; Prepare to display screen DF6FRACINC = 0; Background colors. - how many times the background color can be changed in 1 scan (0 means solid background) DF4FRACINC = 255 ; Playfield colors. DF0FRACINC = 128 ; Column 0. DF1FRACINC = 128 ; Column 1. DF2FRACINC = 128 ; Column 2. DF3FRACINC = 128 ; Column 3. drawscreen ; Monitor RESET and Fire Button if switchselect && !_Bit0_Reset_Restrainer{0} then _Bit0_Reset_Restrainer{0} = 1 : score = score+ 1 : _GameNo=_GameNo+1 if !switchselect && _Bit0_Reset_Restrainer{0} then _Bit0_Reset_Restrainer{0} = 0 if _GameNo = 7 then score = 1 : _GameNo = 1 if !joy0fire then goto __DisplayTitleScreen if _GameNo > 3 then _Lives = 1 else _Lives = 3 score = 0 _Bit0_Reset_Restrainer{0} = 0 _level = 0 goto __levelComplete bank2 ; Place objects - Object placement defined per Level in Bank 2 ;PRESS FIRE TO START NEW GAME