rem **************************************************************** rem **************************************************************** rem * rem * Fake Gravity Platformer Test rem * rem * By Duane Alan Hahn (Random Terrain) using hints, tips, rem * code snippets, and more from AtariAge members such as rem * batari, SeaGtGruff, RevEng, Robert M, Atarius Maximus, rem * jrok, Nukey Shay, supercat, and GroovyBee. rem * rem **************************************************************** rem **************************************************************** set kernel_options player1colors pfcolors no_blank_lines rem **************************************************************** rem * rem * Create aliases for variables. rem * rem **************************************************************** rem ' rem ' (You can have more than one alias for each variable.) rem ' rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' dim P1_Left_Right=player1x.a dim P1_Up_Down=player1y.b dim Convert_X=c dim Convert_Y=d dim Counter_Jump=e dim Gravity_U_Counter=f dim Gravity_Up=g dim Gravity_D_Counter=h dim Gravity_Down=i dim Slide_Counter=j dim Slide_Speed=k dim Slide_Limit=l dim Master_Counter=m dim Frame_Counter=n dim Duration=o dim Counter_Sound_Data=p dim BitOp_01=q dim BitOp_Fall_in_Progress=q dim BitOp_Slide_Left_in_Progress=q dim BitOp_Slide_Right_in_Progress=q dim BitOp_Fire_Debounce=q dim BitOp_Flip_P1=q dim BitOp_Slide_in_Progress=q dim BitOp_Squat_in_Progress=q dim BitOp_Chan_0_Sound=r dim BitOp_Sound_Jump=r dim BitOp_Sound_Fall=r Start_Restart rem @# Start-Restart rem **************************************************************** rem **************************************************************** rem * rem * rem * Program Start/Restart rem * rem * rem **************************************************************** rem **************************************************************** player1x=78 : rem - Sets position of player sprite (across). player1y=79 : rem - Sets position of player sprite (down). AUDV0=0 : rem - Mute channel 0. Convert_X=0 : rem - Converts sprite x position to x playfield position. Convert_Y=0 : rem - Converts sprite y position to y playfield position. Counter_Jump=0 : rem - Limits how high player can jump. Gravity_U_Counter=0 : rem - Fake gravity jump counter. Gravity_Up=3 : rem - Decreases over the time of a jump. Gravity_D_Counter=0 : rem - Fake gravity fall counter. Gravity_Down=0 : rem - Increases over the time of a fall. Slide_Counter=0 : rem - Counter for sliding. Slide_Speed=1 : rem - Becomes slower each time it loops back around. Slide_Limit=0 : rem - Slide is less while running than it is while in air. Master_Counter=0 : rem - Controls animation speed. Frame_Counter=0 : rem - Animation counter. Duration=0 : rem - Sound effect duration for channel 0. Counter_Sound_Data=0 : rem - Sound effect counter for channel 0. BitOp_01=0 : rem - Can clear 8 bits at once if needed. BitOp_Fall_in_Progress{0}=0 : rem - Player is falling if on. BitOp_Slide_Left_in_Progress{1}=0 : rem - Player moved left if on. BitOp_Slide_Right_in_Progress{2}=0 : rem - Player moved right if on. BitOp_Fire_Debounce{3}=0 : rem - Player can't hold down fire button to jump. BitOp_Flip_P1{4}=0 : rem - Flips player sprite when necessary. BitOp_Slide_in_Progress{5}=0 : rem - Lets player slide when direction changes. BitOp_Squat_in_Progress{6}=0 : rem - Allows player to slide while squatting. BitOp_Chan_0_Sound=0 : rem - Can clear 8 bits at once if needed. BitOp_Sound_Jump{0}=0 : rem - Jump sound. BitOp_Sound_Fall{1}=0 : rem - Falling sound. playfield: ................................ ................................ ................................ ................................ ......XXXXXXX......XXXXXXX...... ................................ ................................ ..........XXXXXXXXXXXX.......... ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end Main_Loop rem @# Main Loop rem **************************************************************** rem **************************************************************** rem **************************************************************** rem **************************************************************** rem * rem * rem * MAIN LOOP rem * rem * rem **************************************************************** rem **************************************************************** rem **************************************************************** rem **************************************************************** rem **************************************************************** rem * rem * Set up colors. rem * rem **************************************************************** rem ' COLUPF = $96 : COLUBK=$00 : COLUP1 = $42 pfcolors: $00 $00 $00 $00 $1C $00 $00 $3C $00 $00 $CC $C6 end rem **************************************************************** rem * rem * Convert player sprite position to playfield position. rem * rem **************************************************************** rem ' Convert_X = (player1x-14)/4 Convert_Y = player1y/8 rem **************************************************************** rem * rem * Controls animation speed. rem * rem **************************************************************** rem ' 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 rem **************************************************************** rem * rem * Default standing still position for player sprite. rem * rem **************************************************************** rem ' player1color: $26 $9C $9C $9C $DA $DA $3C $3C $3C $26 end player1: %01100110 %00100100 %00111100 %00011000 %01011010 %00111100 %00011000 %00111100 %00111100 %00011000 end rem @# Jump rem **************************************************************** rem * rem * Jump. rem * rem **************************************************************** rem ' if !joy0fire then Counter_Jump=0 : Gravity_U_Counter=0 : Gravity_Up=3 : BitOp_Fire_Debounce{3}=0 : goto Skip_Jump rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Deactivate running slide while in the air. rem ' BitOp_Slide_in_Progress{5}=0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Use when player moves left or right while jumping or falling. rem ' if !BitOp_Fire_Debounce{3} then player1: %11000011 %01100011 %00111110 %00011100 %00111101 %01011110 %00011000 %00111100 %00111100 %00011000 end rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If player isn't moving left or right, use arms up sprite. rem ' if !joy0left && !joy0right && !BitOp_Fire_Debounce{3} then player1: %01100110 %00100100 %00111100 %00011000 %00011000 %01111110 %10011001 %00111100 %00111100 %00011000 end rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Start jumping sound effect. rem ' if !BitOp_Fire_Debounce{3} && !BitOp_Sound_Jump{0} then BitOp_Chan_0_Sound=0 : BitOp_Sound_Jump{0}=1 : Duration=1 : Counter_Sound_Data = 0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Don't allow jumping if player is falling. rem ' if BitOp_Fall_in_Progress{0} then goto Skip_Jump rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Fixes it so the player can't hold down the fire button to rem ' jump repeatedly. rem ' if BitOp_Fire_Debounce{3} && !BitOp_Fall_in_Progress{0} && !Counter_Jump then goto Skip_Jump BitOp_Fire_Debounce{3}=1 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Reset jump counter if limit is reached and start a fall. rem ' Counter_Jump=Counter_Jump+1 if Counter_Jump > 11 then Counter_Jump=0 : BitOp_Fall_in_Progress{0}=1 : Gravity_U_Counter=0 : Gravity_Up=3 : goto Skip_Jump rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Fake gravity jump (slows down near the top of jump). rem ' Gravity_U_Counter=Gravity_U_Counter+1 if Gravity_U_Counter = 8 then Gravity_U_Counter=0 : if Gravity_Up > 0 then Gravity_Up = Gravity_Up - 1 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Only jump up if nothing is in the way and border is not hit. rem ' temp5 = (player1y-5)/8 if pfread(Convert_X,temp5) then Counter_Jump=0 : BitOp_Fall_in_Progress{0}=1 : Gravity_U_Counter=0 : Gravity_Up=3 : goto Skip_Jump if player1y > 12 then player1y=player1y-Gravity_Up Skip_Jump rem @# Fall rem **************************************************************** rem * rem * Fall down. rem * rem ***************************************************************** rem ' temp5 = (player1y+1)/8 if Counter_Jump || pfread(Convert_X,temp5) then goto Skip_Fall_01 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Deactivate running slide while in the air. rem ' BitOp_Slide_in_Progress{5}=0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Use when player moves left or right while jumping or falling. rem ' player1: %11000011 %01100011 %00111110 %00011100 %00111101 %01011110 %00011000 %00111100 %00111100 %00011000 end rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If player isn't moving left or right, use arms up sprite. rem ' if !joy0left && !joy0right then player1: %01100110 %00100100 %00111100 %00011000 %00011000 %01111110 %10011001 %00111100 %00111100 %00011000 end rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Start falling sound effect. rem ' if BitOp_Sound_Jump{0} then goto Skip_Fall_Sound_Check if Gravity_D_Counter=0 && Gravity_Down=0 then BitOp_Chan_0_Sound=0 : BitOp_Sound_Fall{1}=1 : Duration=1 : Counter_Sound_Data = 0 if Gravity_D_Counter>0 && Gravity_Down=3 then if !BitOp_Sound_Fall{1} && !BitOp_Sound_Jump{1} then BitOp_Chan_0_Sound=0 : BitOp_Sound_Fall{1}=1 : Duration=1 : Counter_Sound_Data = 0 Skip_Fall_Sound_Check rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Fake gravity fall (speed keeps increasing during a fall). rem ' Gravity_D_Counter=Gravity_D_Counter+1 if Gravity_D_Counter = 8 then Gravity_Down = Gravity_Down + 1 : Gravity_D_Counter=0 player1y=player1y+Gravity_Down rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Lets the program know a fall is in progress. rem ' BitOp_Fall_in_Progress{0}=1 goto Skip_Fall_02 Skip_Fall_01 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Not falling. Clear related variables. rem ' BitOp_Fall_in_Progress{0}=0 : Gravity_Down=0 : Gravity_D_Counter=0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If player sprite touches playfield, move up one pixel. rem ' temp5 = (player1y)/8 if pfread(Convert_X,temp5) then player1y=player1y-1 Skip_Fall_02 BitOp_Squat_in_Progress{6}=0 rem @# Squat rem **************************************************************** rem * rem * Squat. rem * rem ***************************************************************** rem ' if !joy0down then goto Skip_Squat BitOp_Squat_in_Progress{6}=1 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Don't squat if jumping or falling. rem ' if BitOp_Fall_in_Progress{0} then goto Skip_Squat if Counter_Jump then goto Skip_Squat player1color: $26 $9C $DA $DA $3C $3C $3C $26 end player1: %01100110 %01111110 %01011010 %00111100 %00011000 %00111100 %00111100 %00011000 end Skip_Squat rem @# Left rem **************************************************************** rem * rem * Left. rem * rem ***************************************************************** rem ' if !joy0left then goto Skip_Joy0Left rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Deactivate running slide while in the air and set up rem ' left/right slide variables and skip the slide check if-thens. rem ' if BitOp_Fall_in_Progress{0} then BitOp_Slide_in_Progress{5}=0 : BitOp_Slide_Left_in_Progress{1}=1 : BitOp_Slide_Right_in_Progress{2}=0 : goto Skip_Slide_Check_Left if Counter_Jump then BitOp_Slide_in_Progress{5}=0 : BitOp_Slide_Left_in_Progress{1}=1 : BitOp_Slide_Right_in_Progress{2}=0 : goto Skip_Slide_Check_Left rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If a running slide is in progress, set up left/right slide rem ' variables and skip this section. rem ' if BitOp_Slide_in_Progress{5} then BitOp_Slide_in_Progress{5}=1 : BitOp_Slide_Left_in_Progress{1}=0 : BitOp_Slide_Right_in_Progress{2}=1 : goto Skip_Joy0Left rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If player was running a different direction, turn on running rem ' slide variable, set up left/right slide variables and skip rem ' this section. rem ' if BitOp_Slide_Right_in_Progress{2} then BitOp_Slide_in_Progress{5}=1 : BitOp_Slide_Left_in_Progress{1}=0 : goto Skip_Joy0Left Skip_Slide_Check_Left rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Don't move left if a pfpixel is in the way. rem ' temp5 = (player1x-18)/4 if pfread(temp5,Convert_Y) then goto Skip_Joy0Left rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Activate left slide and move left if not hitting border. rem ' BitOp_Slide_Left_in_Progress{1}=1 if player1x > 17 then P1_Left_Right=P1_Left_Right - 1.38 player1color: $26 $9C $9C $9C $DA $DA $3C $3C $3C $26 end rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Makes sure player sprite is facing the correct direction. rem ' BitOp_Flip_P1{4}=0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Don't animate if jumping or falling or hitting border. rem ' if Counter_Jump then goto Skip_Joy0Left if BitOp_Fall_in_Progress{0} then goto Skip_Joy0Left if player1x < 18 then goto Skip_Joy0Left on Frame_Counter gosub Frame_00 Frame_01 Frame_00 Frame_02 Skip_Joy0Left rem @# Right rem **************************************************************** rem * rem * Right. rem * rem ***************************************************************** rem ' if !joy0right then goto Skip_Joy0Right rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Deactivate running slide while in the air and set up rem ' left/right slide variables and skip the slide check if-thens. rem ' if BitOp_Fall_in_Progress{0} then BitOp_Slide_in_Progress{5}=0 : BitOp_Slide_Right_in_Progress{2}=1 : BitOp_Slide_Left_in_Progress{1}=0 : goto Skip_Slide_Check_Right if Counter_Jump then BitOp_Slide_in_Progress{5}=0 : BitOp_Slide_Right_in_Progress{2}=1 : BitOp_Slide_Left_in_Progress{1}=0 :goto Skip_Slide_Check_Right rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If a running slide is in progress, set up left/right slide rem ' variables and skip this section. rem ' if BitOp_Slide_in_Progress{5} then BitOp_Slide_in_Progress{5}=1 : BitOp_Slide_Right_in_Progress{2}=0 : BitOp_Slide_Left_in_Progress{1}=1 : goto Skip_Joy0Right rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If player was running a different direction, turn on running rem ' slide variable, set up left/right slide variables and skip rem ' this section. rem ' if BitOp_Slide_Left_in_Progress{1} then BitOp_Slide_in_Progress{5}=1 : BitOp_Slide_Right_in_Progress{2}=0 : goto Skip_Joy0Right Skip_Slide_Check_Right rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Don't move right if a pfpixel is in the way. rem ' temp5 = (player1x-10)/4 if pfread(temp5,Convert_Y) then goto Skip_Joy0Right rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Activate right slide and move right if not hitting border. rem ' BitOp_Slide_Right_in_Progress{2}=1 if player1x < 137 then P1_Left_Right=P1_Left_Right + 1.38 player1color: $26 $9C $9C $9C $DA $DA $3C $3C $3C $26 end rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Makes sure sprite is facing the correct direction. rem ' BitOp_Flip_P1{4}=1 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Don't animate if jumping or falling or hitting border. rem ' if Counter_Jump then goto Skip_Joy0Right if BitOp_Fall_in_Progress{0} then goto Skip_Joy0Right if player1x > 136 then goto Skip_Joy0Right on Frame_Counter gosub Frame_00 Frame_01 Frame_00 Frame_02 Skip_Joy0Right rem @# Slide rem **************************************************************** rem * rem * Slide. rem * rem ***************************************************************** rem ' if BitOp_Slide_in_Progress{5} then goto Skip_Joy_Check if joy0right || joy0left then Slide_Counter=0 : Slide_Speed=1 : goto Skip_Slide Skip_Joy_Check rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If border is hit, reset slide variables. rem ' if player1x < 17 then Slide_Counter=0 : Slide_Speed=1 : BitOp_Slide_in_Progress{5}=0 : BitOp_Slide_Left_in_Progress{1}=0 : BitOp_Slide_Right_in_Progress{2}=1 : goto Skip_Slide if player1x > 136 then Slide_Counter=0 : Slide_Speed=1 : BitOp_Slide_in_Progress{5}=0 : BitOp_Slide_Left_in_Progress{1}=1 : BitOp_Slide_Right_in_Progress{2}=0 : goto Skip_Slide rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If player is standing still, skip this section. rem ' if !BitOp_Slide_Left_in_Progress{1} && !BitOp_Slide_Right_in_Progress{2} then goto Skip_Slide rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If in the middle of jumping or falling, increase slide. rem ' Slide_Limit=31 : BitOp_Slide_in_Progress{5}=1 if BitOp_Fall_in_Progress{0} then Slide_Limit=127 : BitOp_Slide_in_Progress{5}=0 if Counter_Jump then Slide_Limit=127 : BitOp_Slide_in_Progress{5}=0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Use slide sprite if not in the middle of jumping or falling. rem ' if BitOp_Squat_in_Progress{6} then goto Skip_Slide_Sprite if !Counter_Jump && !BitOp_Fall_in_Progress{0} then player1: %01100011 %00110110 %00011100 %00011000 %10111010 %01111100 %00110000 %01111000 %01111000 %00110000 end player1color: $26 $9C $9C $9C $DA $DA $3C $3C $3C $26 end Skip_Slide_Sprite rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If the counter doesn't match the speed, skip this section. rem ' Slide_Counter=Slide_Counter + 1 if Slide_Counter < Slide_Speed then goto Skip_Slide rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Speed becomes slower each time it loops back around. rem ' Slide_Speed=Slide_Speed * 2 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Slide either left or right (last direction player moved). rem ' if BitOp_Slide_Left_in_Progress{1} then P1_Left_Right=P1_Left_Right - 1.04 if BitOp_Slide_Right_in_Progress{2} then P1_Left_Right=P1_Left_Right + 1.04 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' If the slowest speed is reached, stop sliding. rem ' if Slide_Speed > Slide_Limit then Slide_Speed=1 : Slide_Counter=0 : BitOp_Slide_Left_in_Progress{1}=0 : BitOp_Slide_Right_in_Progress{2}=0 : BitOp_Slide_in_Progress{5}=0 Skip_Slide rem **************************************************************** rem * Flip player sprite when necessary. rem ' REFP1=0 : if !BitOp_Flip_P1{4} then Skip_Main_Flip REFP1=8 Skip_Main_Flip rem @# Sound Effect Jump rem **************************************************************** rem * rem * Sound effects for Channel 0. rem * rem **************************************************************** rem ' rem ' Check for end of current note. rem ' if !BitOp_Chan_0_Sound then goto Sound_Return_Channel_0 Duration = Duration - 1 if Duration > 0 then goto Sound_Return_Channel_0 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Fall sound. rem ' if BitOp_Sound_Jump{0} then goto Sound_Effect_Jump rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Ship Ouch Sound. rem ' if BitOp_Sound_Fall{1} then goto Sound_Effect_Fall Sound_Return_Channel_0 rem **************************************************************** rem * Reset Program: rem * Any Atari 2600 program should restart when the reset switch rem * is pressed. It is part of the usual standards and procedures. rem ' if switchreset then goto Start_Restart drawscreen goto Main_Loop rem @# Sound Effects rem **************************************************************** rem **************************************************************** rem * rem * rem * Sound effects start here. rem * rem * rem **************************************************************** rem **************************************************************** Sound_Effect_Jump rem **************************************************************** rem * rem * Jump sound. rem * rem **************************************************************** rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Retrieve channel 0 data. rem ' temp4 = Sound_Data_Jump[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 temp5 = Sound_Data_Jump[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 temp6 = Sound_Data_Jump[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Check for end of data. rem ' if temp4=255 then goto Sound_Done_255 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Play channel 0 rem ' AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Set Duration. rem ' Duration = Sound_Data_Jump[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 goto Sound_Return_Channel_0 data Sound_Data_Jump 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 255 end Sound_Effect_Fall rem **************************************************************** rem * rem * Falling sound. rem * rem **************************************************************** rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Retrieve channel 0 data rem ' temp4 = Sound_Data_Fall[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 temp5 = Sound_Data_Fall[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 temp6 = Sound_Data_Fall[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Check for end of data. rem ' if temp4=255 then goto Sound_Done_255 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Play channel 0 rem ' AUDV0 = temp4 AUDC0 = temp5 AUDF0 = temp6 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Set Duration. rem ' Duration = Sound_Data_Fall[Counter_Sound_Data] : Counter_Sound_Data = Counter_Sound_Data + 1 goto Sound_Return_Channel_0 data Sound_Data_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 Sound_Done_255 rem **************************************************************** rem * Clear and set channel 0 related sound variables. rem ' Duration=1 : Counter_Sound_Data = 0 : BitOp_Chan_0_Sound=0 : AUDV0=0 : goto Sound_Return_Channel_0 rem @# Animation Frames rem **************************************************************** rem * rem * Animation frames for player. rem * rem **************************************************************** Frame_00 player1: %01100110 %00100110 %00111100 %00011100 %00111100 %00011100 %00011000 %00111100 %00111100 %00011000 end return Frame_01 player1: %11000011 %01100011 %00111110 %00011100 %00111100 %01011110 %00011000 %00111100 %00111100 %00011000 end return Frame_02 player1: %00111100 %00011100 %00011100 %00011100 %00011100 %00011100 %00011000 %00111100 %00111100 %00011000 end return