bank 1 temp1 = temp1 set tv ntsc set romsize 8k set kernel_options player1colors pfcolors no_blank_lines dim bmp_48x1_1_index = n dim bmp_48x1_1_color = n dim frame = o dim bmp_48x1_2_color = p dim gamenumber=q dim swdebounce=r scorecolor=$84 swdebounce=0 gamenumber=1 titlepage gosub titledrawscreen bank2 if joy0fire || switchreset then goto gamestart if !switchselect then swdebounce=0 if swdebounce>0 then swdebounce=swdebounce-1: goto titlepage if switchselect then swdebounce=30: gamenumber=gamenumber+1 if gamenumber=21 then gamenumber=1 frame=frame+1 bmp_48x1_1_color=$0e : bmp_48x1_1_index=0 if frame{0} then bmp_48x1_1_color=$40 : bmp_48x1_1_index = 87 bmp_48x1_2_color = bmp_48x1_2_color + 1 goto titlepage gamestart dim _P1_Left_Right = player1x.a dim _Convert_X = b dim _Convert_Y = c dim _Jump_Gravity_Counter = d dim _Fall_Gravity_Counter = e dim _Slide_Counter = f dim _Slide_Speed = g dim _Slide_Limit = h dim _Master_Counter = i dim _Frame_Counter = j dim _Ch0_Sound = k dim _Ch0_Duration = l dim _Ch0_Counter = m dim enemy = s dim enemy3 = n dim hittimer = o dim timer3 =p dim ssc1 = q dim ssc2 = r dim ssc3 = t dim secondscore = v dim secondscorecolor = w dim _BitOp_02 = x dim _Bit6_LR_Joy_Movement = x dim _BitOp_01 = y dim _Bit0_Fall_in_Progress = y dim _Bit1_Slide_Left_in_Progress = y dim _Bit2_Slide_Right_in_Progress = y dim _Bit3_FireB_Restrainer = y dim _Bit4_Flip_P1 = y dim _Bit5_Ground_Slide_in_Progress = y dim _Bit6_Duck_in_Progress = y dim _Bit7_Reset_Restrainer = y const _c_Jump_Sound = 1 const _c_Fall_Sound = 2 const _c_Slide_Sound = 3 const _c_Sound_Shot = 4 __Start_Restart scorecolor = $0E secondscorecolor = $84 score = 000000 ssc1 = $99 ssc2 = $AA ssc3 = $10 AUDV0 = 0 : AUDV1 = 0 _Slide_Speed = 1 player1x = 79 : player1y = 79 _Bit7_Reset_Restrainer{7} = 1 playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXX....................XXXXXX ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end __Main_Loop COLUPF = $96 : COLUBK = $00 : COLUP1 = $40 pfcolors: $0C $0C $0C $0C $84 $00 $0C $44 $00 $0C $CA $00 end _Convert_X = (player1x-14)/4 _Convert_Y = player1y/8 _Master_Counter = _Master_Counter + 1 if _Master_Counter < 4 then goto __Skip_Frame_Counter _Frame_Counter = _Frame_Counter + 1 : _Master_Counter = 0 if _Frame_Counter = 4 then _Frame_Counter = 0 __Skip_Frame_Counter player1color: $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 end player1: %00111101 %00111010 %00000000 %00011000 %00101100 %01111010 %01101010 %00111100 %00011110 %00111101 %01011010 %00011010 %11101101 %00111110 %01101111 %11111010 end if !joy0fire then _Jump_Gravity_Counter = 0 : _Bit3_FireB_Restrainer{3} = 0 : goto __Skip_Jump _Bit5_Ground_Slide_in_Progress{5} = 0 if !_Bit3_FireB_Restrainer{3} then player1: %00111100 %01111110 %11111111 %11111111 %11111111 %11011111 %01001110 %00111100 end if !joy0left && !joy0right && !_Bit3_FireB_Restrainer{3} then player1: %00111100 %01111110 %11111111 %11111111 %11111111 %11011111 %01001110 %00111100 end if _Bit0_Fall_in_Progress{0} then goto __Skip_Jump if _Bit3_FireB_Restrainer{3} && !_Bit0_Fall_in_Progress{0} && !_Jump_Gravity_Counter then goto __Skip_Jump if !_Jump_Gravity_Counter then _Ch0_Sound = _c_Jump_Sound : _Ch0_Duration = 1 : _Ch0_Counter = 0 _Bit3_FireB_Restrainer{3} = 1 _Jump_Gravity_Counter = _Jump_Gravity_Counter + 1 if _Jump_Gravity_Counter > 12 then _Jump_Gravity_Counter = 0 : _Bit0_Fall_in_Progress{0} = 1 : goto __Skip_Jump if player1y < 13 then goto __Skip_Jump if _Jump_Gravity_Counter <= 7 then temp6 = 3 if _Jump_Gravity_Counter > 7 && _Jump_Gravity_Counter <= 10 then temp6 = 2 if _Jump_Gravity_Counter > 10 then temp6 = 1 player1y = player1y - temp6 temp5 = (player1y-5)/8 if pfread(_Convert_X,temp5) then _Jump_Gravity_Counter = 0 : _Bit0_Fall_in_Progress{0} = 1 : goto __Skip_Jump __Skip_Jump temp5 = (player1y+1)/8 if _Jump_Gravity_Counter || pfread(_Convert_X,temp5) then goto __Skip_Fall_01 player1: %00111100 %01111110 %11111111 %11111111 %11111111 %11011111 %01001110 %00111100 end if !joy0left && !joy0right then player1: %00111100 %01111110 %11111111 %11111111 %11111111 %11011111 %01001110 %00111100 end _Fall_Gravity_Counter = _Fall_Gravity_Counter + 1 temp6 = 0 if _Fall_Gravity_Counter > 8 && _Jump_Gravity_Counter <= 16 then temp6 = 1 if _Fall_Gravity_Counter > 16 && _Jump_Gravity_Counter <= 24 then temp6 = 2 if _Fall_Gravity_Counter > 24 && _Jump_Gravity_Counter <= 32 then temp6 = 3 if _Fall_Gravity_Counter > 32 then temp6 = 4 player1y = player1y + temp6 if _Ch0_Sound = _c_Jump_Sound || _Ch0_Sound = _c_Fall_Sound then goto __Skip_Fall_Sound_Check if _Fall_Gravity_Counter = 17 || _Fall_Gravity_Counter = 27 then _Ch0_Sound = _c_Fall_Sound : _Ch0_Duration = 1 : _Ch0_Counter = 0 __Skip_Fall_Sound_Check _Bit0_Fall_in_Progress{0} = 1 _Bit5_Ground_Slide_in_Progress{5} = 0 goto __Skip_Fall_02 __Skip_Fall_01 _Bit0_Fall_in_Progress{0} = 0 : _Fall_Gravity_Counter = 0 temp5 = (player1y)/8 if pfread(_Convert_X,temp5) then player1y = player1y - 1 __Skip_Fall_02 _Bit6_Duck_in_Progress{6} = 0 if !joy0down then goto __Skip_Duck if _Bit0_Fall_in_Progress{0} || _Jump_Gravity_Counter then goto __Skip_Duck _Bit6_Duck_in_Progress{6} = 1 player1color: $40 $40 $40 $40 $40 $40 $40 $40 end player1: %00111100 %01111110 %11111111 %11111111 %11111111 %11011111 %01001110 %00111100 end __Skip_Duck _Bit6_LR_Joy_Movement{6} = 0 if !joy0left then goto __Skip_Joy0Left if _Bit0_Fall_in_Progress{0} || _Jump_Gravity_Counter then _Bit5_Ground_Slide_in_Progress{5} = 0 : _Bit1_Slide_Left_in_Progress{1} = 1 : _Bit2_Slide_Right_in_Progress{2} = 0 : goto __Skip_Slide_Check_Left if _Bit5_Ground_Slide_in_Progress{5} then _Bit5_Ground_Slide_in_Progress{5} = 1 : _Bit1_Slide_Left_in_Progress{1} = 0 : _Bit2_Slide_Right_in_Progress{2} = 1 : goto __Skip_Joy0Left if _Bit2_Slide_Right_in_Progress{2} then _Bit5_Ground_Slide_in_Progress{5} = 1 : _Bit1_Slide_Left_in_Progress{1} = 0 : goto __Skip_Joy0Left __Skip_Slide_Check_Left temp5 = (player1x-18)/4 if pfread(temp5,_Convert_Y) then goto __Skip_Joy0Left _Bit1_Slide_Left_in_Progress{1} = 1 : _Bit6_LR_Joy_Movement{6} = 1 if player1x > 17 then _P1_Left_Right = _P1_Left_Right - 1.38 _Bit4_Flip_P1{4} = 0 __Skip_Joy0Left if !joy0right then goto __Skip_Joy0Right if _Bit0_Fall_in_Progress{0} || _Jump_Gravity_Counter then _Bit5_Ground_Slide_in_Progress{5} = 0 : _Bit2_Slide_Right_in_Progress{2} = 1 : _Bit1_Slide_Left_in_Progress{1} = 0 : goto __Skip_Slide_Check_Right if _Bit5_Ground_Slide_in_Progress{5} then _Bit5_Ground_Slide_in_Progress{5} = 1 : _Bit2_Slide_Right_in_Progress{2} = 0 : _Bit1_Slide_Left_in_Progress{1} = 1 : goto __Skip_Joy0Right if _Bit1_Slide_Left_in_Progress{1} then _Bit5_Ground_Slide_in_Progress{5} = 1 : _Bit2_Slide_Right_in_Progress{2} = 0 : goto __Skip_Joy0Right __Skip_Slide_Check_Right temp5 = (player1x-10)/4 if pfread(temp5,_Convert_Y) then goto __Skip_Joy0Right _Bit2_Slide_Right_in_Progress{2} = 1 : _Bit6_LR_Joy_Movement{6} = 1 if player1x < 137 then _P1_Left_Right = _P1_Left_Right + 1.38 _Bit4_Flip_P1{4} = 1 __Skip_Joy0Right if !_Bit6_LR_Joy_Movement{6} then goto __Done_Anim_jump if _Jump_Gravity_Counter || _Bit0_Fall_in_Progress{0} then goto __Done_Anim_jump if player1x < 18 || player1x > 136 then goto __Done_Anim_jump player1color: $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 end on _Frame_Counter goto __Frame0 __Frame1 __Frame0 __Frame2 __Done_Anim_jump if _Bit5_Ground_Slide_in_Progress{5} then goto __Skip_Joy0_Slide_Check if joy0right || joy0left then _Slide_Counter = 0 : _Slide_Speed = 1 : goto __Skip_Slide __Skip_Joy0_Slide_Check if player1x < 17 then _Slide_Counter = 0 : _Bit5_Ground_Slide_in_Progress{5} = 0 : _Bit1_Slide_Left_in_Progress{1} = 0 : _Slide_Speed = 1 : _Bit2_Slide_Right_in_Progress{2} = 1 : goto __Skip_Slide if player1x > 137 then _Slide_Counter = 0 : _Bit5_Ground_Slide_in_Progress{5} = 0 : _Bit2_Slide_Right_in_Progress{2} = 0 : _Slide_Speed = 1 : _Bit1_Slide_Left_in_Progress{1} = 1 : goto __Skip_Slide if !_Bit1_Slide_Left_in_Progress{1} && !_Bit2_Slide_Right_in_Progress{2} then goto __Skip_Slide _Slide_Limit = 31 : _Bit5_Ground_Slide_in_Progress{5} = 1 if _Bit0_Fall_in_Progress{0} || _Jump_Gravity_Counter then _Slide_Limit = 127 : _Bit5_Ground_Slide_in_Progress{5} = 0 if _Bit6_Duck_in_Progress{6} then goto __Skip_Slide_Sprite if _Jump_Gravity_Counter || _Bit0_Fall_in_Progress{0} then goto __Skip_Slide_Sprite player1: %00101000 %01111000 %10010100 %00001010 %10100001 %11001101 %00101010 %00010100 %01111000 %10111100 %00000000 %10111010 %01000111 %10111100 %11110110 %01011111 end player1color: $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 $40 end __Skip_Slide_Sprite if _Slide_Counter = 0 && _Ch0_Sound = 0 then if !_Bit0_Fall_in_Progress{0} then _Ch0_Sound = _c_Slide_Sound : _Ch0_Duration = 1 : _Ch0_Counter = 0 _Slide_Counter = _Slide_Counter + 1 if _Slide_Counter < _Slide_Speed then goto __Skip_Slide _Slide_Speed = _Slide_Speed * 2 if _Bit1_Slide_Left_in_Progress{1} then _P1_Left_Right = _P1_Left_Right - 1.04 if _Bit2_Slide_Right_in_Progress{2} then _P1_Left_Right = _P1_Left_Right + 1.04 if _Slide_Speed > _Slide_Limit then _Slide_Speed = 1 : _Slide_Counter = 0 : _Bit1_Slide_Left_in_Progress{1} = 0 : _Bit2_Slide_Right_in_Progress{2} = 0 : _Bit5_Ground_Slide_in_Progress{5} = 0 __Skip_Slide if _Bit4_Flip_P1{4} then REFP1 = 8 if !_Ch0_Sound then goto __Skip_Ch_0 _Ch0_Duration = _Ch0_Duration - 1 if _Ch0_Duration then goto __Skip_Ch_0 if _Ch0_Sound <> _c_Jump_Sound then goto __Skip_Ch0_Sound_001 temp4 = _SD_Jump[_Ch0_Counter] if temp4 = 255 then goto __Clear_Ch_0 _Ch0_Counter = _Ch0_Counter + 1 temp5 = _SD_Jump[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 temp6 = _SD_Jump[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 _Ch0_Duration = _SD_Jump[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 goto __Skip_Ch_0 __Skip_Ch0_Sound_001 if _Ch0_Sound <> _c_Fall_Sound then goto __Skip_Ch0_Sound_002 temp4 = _SD_Fall[_Ch0_Counter] if temp4 = 255 then goto __Clear_Ch_0 _Ch0_Counter = _Ch0_Counter + 1 temp5 = _SD_Fall[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 temp6 = _SD_Fall[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 _Ch0_Duration = _SD_Fall[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 goto __Skip_Ch_0 __Skip_Ch0_Sound_002 if _Ch0_Sound <> _c_Slide_Sound then goto __Skip_Ch0_Sound_003 temp4 = _SD_Slide[_Ch0_Counter] if temp4 = 255 then goto __Clear_Ch_0 _Ch0_Counter = _Ch0_Counter + 1 temp5 = _SD_Slide[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 temp6 = _SD_Slide[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 _Ch0_Duration = _SD_Slide[_Ch0_Counter] : _Ch0_Counter = _Ch0_Counter + 1 goto __Skip_Ch_0 __Skip_Ch0_Sound_003 goto __Skip_Ch_0 __Clear_Ch_0 _Ch0_Sound = 0 : AUDV0 = 0 __Skip_Ch_0 drawscreen if !switchreset then _Bit7_Reset_Restrainer{7} = 0 : goto __Main_Loop if _Bit7_Reset_Restrainer{7} then goto __Main_Loop goto __Start_Restart data _SD_Jump 1,12,31 1 8,12,31 1 6,12,31 1 8,12,31 1 8,12,30 1 8,12,29 1 8,12,28 1 8,12,27 1 8,12,26 1 8,12,25 1 8,12,24 1 8,12,23 1 8,12,22 1 8,12,21 1 8,12,20 1 8,12,19 1 6,12,18 1 4,12,17 1 2,12,16 2 0,0,0 8 255 end data _SD_Fall 6,12,16 1 8,12,16 1 6,12,17 1 8,12,17 1 6,12,18 1 8,12,18 1 6,12,19 1 8,12,19 1 6,12,20 1 8,12,20 1 6,12,21 1 8,12,21 1 6,12,22 1 8,12,22 1 6,12,23 1 8,12,23 1 6,12,24 1 8,12,24 1 6,12,25 1 8,12,25 1 6,12,26 1 8,12,26 1 6,12,27 1 8,12,27 1 6,12,28 1 8,12,28 1 6,12,29 1 8,12,29 1 6,12,30 1 8,12,30 1 6,12,31 1 2,12,31 2 255 end data _SD_Slide 2,4,22 1 1,4,21 1 2,4,24 1 1,4,20 1 2,4,23 1 1,4,25 1 2,4,22 1 1,4,20 1 2,4,25 1 1,4,21 1 2,4,25 1 1,4,22 1 2,4,23 1 1,4,22 1 2,4,20 1 1,4,24 1 2,4,21 1 1,4,23 1 2,4,25 1 1,4,24 1 2,4,22 1 255 end __Frame0 player1: %10111100 %01011100 %00000000 %00011000 %00110100 %01011110 %01010110 %00111100 %01111000 %10111100 %01011010 %01011000 %10110111 %01111100 %11110110 %01011111 end goto __Done_Anim_jump __Frame1 player1: %00000001 %01000011 %11000011 %11001100 %10011000 %00111010 %10110111 %01010011 %01111010 %10111100 %01011010 %01011000 %10110111 %01111100 %11110110 %01011111 end goto __Done_Anim_jump __Frame2 player1: %10111100 %01011100 %00000000 %00011000 %00110100 %01011110 %01010110 %00111100 %01111000 %10111100 %01011010 %01011000 %10110111 %01111100 %11110110 %01011111 end goto __Done_Anim_jump cyclonaut rem (t,u & z are remaining variables) temp1=player0y+11 if temp2temp1 then goto __Main_Loop temp1=player0x+15 if temp3temp1 then goto __Main_Loop if enemy=10 || enemy3=11 then player0y=200:enemy3=0:z{7}=1:goto __Main_Loop hittimer=t+10:z{4}=1 goto __Main_Loop if t{4} then player0: %00111100 %01111110 %11100111 %11011011 %00011000 %11100111 %01111110 %00111100 end if player0x<16 && player0y<10 then player0y=200:enemy3=0 if player0x>136 && player0y<10 then player0y=200:enemy3=0 if player0y<1 then u{6}=0 if player0y>150 then u{6}=1 if u{6} then player0y=player0y-1 else player0y=player0y+1 if timer3<>70 then goto enemymove timer3=0 if rand>128 then u{2}=0 else u{2}=1 if rand<64 then u{6}=0 else u{6}=1 goto enemymove enemymove if player0x<16 then u{2}=1 if player0x>136 then u{2}=0 if u{2} then player0x=player0x+1 else player0x=player0x-1 timer3=timer3+1 goto __Main_Loop inline secondscore.asm goto gamestart bank 2 temp1 = temp1 asm include "titlescreen/asm/titlescreen.asm" end