Jump to content

Rabbit 2600

Members
  • Posts

    745
  • Joined

  • Last visited

Everything posted by Rabbit 2600

  1. Managed to get the enemy to move the way I want too. But I have another question: I have multiple screens in my main loop, and "p" determines which screen the player goes to. If p = 0 then it's screen 1, if p = 1 then it's screen 2 and so on. How do I make it so that the enemy only shows if p = 3, that is screen 3? This is how my screens are handled: drawscreen if player1x = 138 then player1x = 18 : p = (rand&3) + 1 if p = 0 then goto Screen_1 : p = 0 if p = 1 then goto Screen_2 : p = 0 if p = 2 then goto Screen_3 : p = 0 if p = 3 then goto Screen_4 : p = 0 goto Main_Loop I tried making the enemy appear by doing this but it dosn't work: drawscreen if player1x = 138 then player1x = 18 : p = (rand&3) + 1 if p = 0 then goto Screen_1 : player0x = 255 : player0y = 255 : p = 0 if p = 1 then goto Screen_2 : player0x = 255 : player0y = 255 : p = 0 if p = 2 then goto Screen_3 : player0x = 50 : player0y = 50 : p = 0 if p = 3 then goto Screen_4 : player0x = 255 : player0y = 255 : p = 0 goto Main_Loop
  2. Haha, I'm making progress. I made a silly misstake of making player1 positions instead of player0 XD
  3. Thank you. I will see if I can get things working the way I want =)
  4. I'm in a bit of a pickle that I don't really know how to fix. I'm trying to have an enemy on certain levels. (player0y is the enemy) and I'm trying to get it working on level 3 in this case. Having him moving from right to the left and reseting when hitting the edge of the left screen. But I can't get it working =/ Ask if I'm unclear about something, I know I'm not very good at explaining. Source: 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 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 AUDV0=0 AUDV1=0 p = 0 Start_Restart rem @# Start-Restart rem **************************************************************** rem **************************************************************** rem * rem * rem * Program Start/Restart rem * rem * rem **************************************************************** rem **************************************************************** player1x=18 player1y=79 Convert_X=0 Convert_Y=0 Counter_Jump=0 Gravity_U_Counter=0 Gravity_Up=0 Gravity_D_Counter=0 Gravity_Down=0 Slide_Counter=0 Slide_Speed=1 Slide_Limit=0 Master_Counter=0 Frame_Counter=0 BitOp_01=0 CTRLPF = $21 ballheight = 4 Screen_1 if p = 0 then playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ .........XX..XX..XX............. .......XXXX......XXXX........... XXXXXXXXXXX......XXXXXXXXXXXXXXX end Screen_2 if p = 1 then playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXX..XX..XX..XXXXXXXXXXX end Screen_3 player0x = player0x - 1 if p = 2 then playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end Screen_4 if p = 3 then playfield: ................................ ................................ ................................ ...........XXXXXXXX............. ................................ .....................XX......... ................................ ...........XXXXXXXX............. ................................ .......XX....................... XXXXXXXXX..............XXXXXXXXX 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=$A6 : COLUP1 = $42 pfcolors: $00 $00 $00 $00 $1C $00 $00 $1E $00 $CC $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=2 : BitOp_Fire_Debounce{3}=0 : goto Skip_Jump 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 ' 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. rem ' temp5 = (player1y-5)/8 if pfread(Convert_X,temp5) then 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 ' 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 ' 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 rem @# Squat rem **************************************************************** rem * rem * Squat. rem * rem ***************************************************************** rem ' if !joy0down then goto Skip_Squat 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 if z = 1 then player0: %01000010 %00111100 %01111110 %10111101 %10011001 %11000011 %10000011 %11000000 end rem @# Left rem **************************************************************** rem * rem * Left. rem * rem ***************************************************************** rem ' if !joy0left then goto Skip_Joy0Left 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 > 16 then P1_Left_Right=P1_Left_Right - 0.50 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. rem ' if Counter_Jump then goto Skip_Joy0Left if BitOp_Fall_in_Progress{0} 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 ' 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 < 139 then P1_Left_Right=P1_Left_Right + 0.50 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. rem ' if Counter_Jump then goto Skip_Joy0Right if BitOp_Fall_in_Progress{0} 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 joy0right || joy0left then Slide_Counter=0 : Slide_Speed=1 : goto Skip_Slide 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 if BitOp_Fall_in_Progress{0} then Slide_Limit=127 if Counter_Jump then Slide_Limit=127 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Use slide sprite if not in the middle of jumping or falling. rem ' if !Counter_Jump && !BitOp_Fall_in_Progress{0} then player1: %01100011 %00110110 %00011100 %00011000 %10111010 %01111100 %00110000 %01111000 %01111000 %00110000 end 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} && player1x > 16 then P1_Left_Right=P1_Left_Right - 1.02 if BitOp_Slide_Right_in_Progress{2} && player1x < 139 then P1_Left_Right=P1_Left_Right + 1.02 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 Skip_Slide rem **************************************************************** rem * Flip player sprite if necessary. rem ' REFP1=0 : if !BitOp_Flip_P1{4} then Skip_Main_Flip REFP1=8 Skip_Main_Flip 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 if player1x = 138 then player1x = 18 : p = (rand&3) + 1 if p = 0 then goto Screen_1 : p = 0 if p = 1 then goto Screen_2 : p = 0 if p = 2 then goto Screen_3 : p = 0 : z = 1 if p = 3 then goto Screen_4 : p = 0 if z = 0 then player0x = 50 : player0y = 50 goto Main_Loop 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
  5. Okay, I'm toying around with sprite position to playfield position and I noticed setting up normal collisions dosn't work (or I'm doing something very wrong) What would be the propper way of doing a collision between player0 and ball? 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 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 AUDV0=0 AUDV1=0 Start_Restart rem @# Start-Restart rem **************************************************************** rem **************************************************************** rem * rem * rem * Program Start/Restart rem * rem * rem **************************************************************** rem **************************************************************** player1x=18 player1y=79 ballx = 70 bally = 60 Convert_X=0 Convert_Y=0 Counter_Jump=0 Gravity_U_Counter=0 Gravity_Up=0 Gravity_D_Counter=0 Gravity_Down=0 Slide_Counter=0 Slide_Speed=1 Slide_Limit=0 Master_Counter=0 Frame_Counter=0 BitOp_01=0 SCREEN1 if p = 0 then playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ .........XX..XX................. .......XXXX..................... XXXXXXXXXXX..XX..XX..XXXXXXXXXXX end SCREEN2 if p = 1 then playfield: ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ ................................ 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=$A6 : 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=2 : BitOp_Fire_Debounce{3}=0 : goto Skip_Jump 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 ' 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. rem ' temp5 = (player1y-5)/8 if pfread(Convert_X,temp5) then 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 ' 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 ' 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 rem @# Squat rem **************************************************************** rem * rem * Squat. rem * rem ***************************************************************** rem ' if !joy0down then goto Skip_Squat 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 ' 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 > 16 then P1_Left_Right=P1_Left_Right - 0.50 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. rem ' if Counter_Jump then goto Skip_Joy0Left if BitOp_Fall_in_Progress{0} 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 ' 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 < 139 then P1_Left_Right=P1_Left_Right + 0.50 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. rem ' if Counter_Jump then goto Skip_Joy0Right if BitOp_Fall_in_Progress{0} 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 joy0right || joy0left then Slide_Counter=0 : Slide_Speed=1 : goto Skip_Slide 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 if BitOp_Fall_in_Progress{0} then Slide_Limit=127 if Counter_Jump then Slide_Limit=127 rem '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' rem ' Use slide sprite if not in the middle of jumping or falling. rem ' if !Counter_Jump && !BitOp_Fall_in_Progress{0} then player1: %01100011 %00110110 %00011100 %00011000 %10111010 %01111100 %00110000 %01111000 %01111000 %00110000 end 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} && player1x > 16 then P1_Left_Right=P1_Left_Right - 1.02 if BitOp_Slide_Right_in_Progress{2} && player1x < 139 then P1_Left_Right=P1_Left_Right + 1.02 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 Skip_Slide rem **************************************************************** rem * Flip player sprite if necessary. rem ' REFP1=0 : if !BitOp_Flip_P1{4} then Skip_Main_Flip REFP1=8 Skip_Main_Flip 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 if collision(player0,ball) then reboot goto Main_Loop 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
  6. Hm, I liked Autumn's Super Fussball. But, I would like to hear some background music.
  7. Experimenting with banks and I find them very confusing. I'm using the platformer (4k) as a base. (I'm sorry, I forgot who made it) In order to learn both platforming and banking coding. I'm having a bit of an issue as to where I should put this line of code so that the player can proceed to the next level: if player0x = 140 then q = q + 1 : player0x = 25 q is a counter. It starts at 0, and thusly the first screen is shown. When player0 reaches 140 on the x axis he is then placed at position 25 on the x axis and q is increased by 1 and then screen number 2 should show. But nothing happens. Any ideas? Source: def GRAVITY=0.05 def JUMPVELOCITY=0.9 set romsize 8kSC set smartbranching on rem set kernel_options pfcolors const pfres=22 dim yvel=a.b dim ypos=c.d dim flags=e def REFLECT=flags{3} def JUMPING=flags{4} dim count=flags rem count uses bits 5-7 of flags dim rjoy=flags rem rjoy uses bits 0-2 of flags rem if using superchip: rem variables f-z and var0-var47 are free rem superchip variables r000-r039 free player0x=20:player0y=20 missile0x = 50 missile0y = 70 player1x = 125 player1y = 31 if q = 0 then playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XXXX..XX..XXXXXXXXXXXXXXXXXXXXXX XX............................XX XX....XX......................XX XX.............................. XX....XX........................ XX.............................. XX..XXXXXXXXXX..XX..XXXXXXXXXXXX XX............................XX XX..............XX............XX XX............................XX XX..............XX............XX XX............................XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end if q = 1 then playfield: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XX.............................. XX.............................. XX.............................. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XX............................XX XX............................XX XX............................XX XX............................XX XX............................XX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end c=20 goto continue bank2 bank 2 rem this is located in bank 2 because pfread lives there continue drawscreen if collision(player0,missile0) then missile0x = rand : missile0y = rand if collision(missile0,playfield) then missile0x = rand : missile0y = rand if player0x = 140 then q = q + 1 : player0x = 25 if missile0x < 20 then missile0x = rand if missile0x > 135 then missile0x = rand if missile0y < 10 then missile0y = rand if missile0y > 80 then missile0y = rand count=count+32 if JUMPING then werejumping if !joy0fire then nobutton yvel=JUMPVELOCITY JUMPING=1 nobutton if !JUMPING then nojump werejumping yvel=yvel-GRAVITY ypos=ypos-yvel nojump temp1=a|b:if temp1=0 then checkfall if !a{7} then skipadd checkfall if player0x<10 || player0x>142 then keepfall rem height from XY rem 0=keep falling, 1=hit exactly, 2=hit too low, move up gosub heightread temp3=c+2 temp3=temp3&3 if temp2=0 then keepfall if temp3=1 then stopjump if temp3>1 then addandstop keepfall JUMPING=1 goto skipadd addandstop c=c-1 stopjump JUMPING=0:d=255:a=0:b=0 skipadd if c>$64 then c=0 player0y=c if count{5} then neg rjoy=(rjoy & %11111000) | (SWCHA/32) if rjoy{0} then noduck player0: %01100110 %01111110 %00011000 %01111110 %00011000 %00111100 %00111100 %00011000 0 0 end goto neg noduck if rjoy{1} then check7 REFLECT=0 temp1=blockread(player0x,c):if temp1=0 then player0x=player0x-1 if player0x<7 then player0x=player0x+1 rem goto donereadingjoy check7 if rjoy{2} then donereadingjoy REFLECT=1 temp1=player0x+7 temp1=blockread(temp1,c):if temp1=0 then player0x=player0x+1 if player0x>$91 then player0x=player0x-1 donereadingjoy if !rjoy{2} || !rjoy{1} then running player0: %01100110 %01100110 %00111100 %00011000 %00011000 %01111110 %00011000 %00111100 %00111100 %00011000 end goto neg running if count{6} then frame24 if count{7} then frame3 player0: %01100011 %01100110 %00111100 %00011000 %01111000 %01011011 %00011110 %00111000 %00111000 %00010000 end goto neg frame3 player0: %00011000 %01111000 %00111000 %00011000 %00111000 %00111100 %00011000 %00111000 %00111000 %00010000 end goto neg frame24 if !count{7} then frame2 player0: %11001100 %01101100 %00111000 %00011000 %01111000 %00111110 %00011100 %00111000 %00111000 %00010000 end goto neg frame2 player0: %00110000 %00111110 %00011100 %00011000 %00011110 %00111100 %00011000 %00111000 %00111000 %00010000 end neg f=f+1 if f = 10 then player1: %01101100 %00100100 %00000000 %00111100 %00000000 %00111100 %01010110 %01010110 %01111110 %00111100 end if f = 20 then player1: %11000110 %01000010 %00000000 %00111100 %00000000 %00111100 %01010110 %01010110 %01111110 %00111100 end if f=20 then f=0 goto continue function pfget if pfread(temp1,temp2) then temp1=1 else temp1=0 return thisbank function blockread temp1=temp1-17:temp1=temp1/4 temp2=temp2/4 rem pfpixel temp1 temp2 flip if temp1>31 then temp1=0:return thisbank temp1=pfget(temp1,temp2) return thisbank heightread temp5=c+1 temp5=temp5/4 temp3=player0x-16 temp4=temp3+1:temp4=temp4/4 temp3=temp3/4:if temp3>$3d then temp6=0:temp4=0:goto skipfirst temp6=pfget(temp3,temp5) if temp4>temp3 then temp3=pfget(temp4,temp5):temp6=temp6|temp3 temp4=temp4+1 skipfirst temp2=temp6 rem pfpixel temp4 temp5 flip if temp4<$20 then temp2=pfget(temp4,temp5):temp2=temp2|temp6 return thisbank vblank scorecolor=15 COLUPF=178 COLUP0=$34 COLUP1=$0E REFP0=flags return
  8. Cheers, I think I got DPC+ under control now =)
  9. Still working. I'm having a bit of a writers block at the moment =/
  10. Ahh, cheers. Now I should be able to get things going =)
  11. Hm, I get an error saying: Compile started at 2013-10-05 00:25:13 Compiling C:\atari\Dead Road\default.bas DASM V2.20.07, Macro Assembler ©1988-2003 bytes of ROM space left 1820 bytes of ROM space left 1820 bytes of ROM space left --- Unresolved Symbol List pfcenter 0000 ???? (R ) player2height 0000 ???? (R ) kernelmacrodef 0000 ???? (R ) pfhalfwidth 0000 ???? (R ) player2pointerhi 0000 ???? (R ) player2pointerlo 0000 ???? (R ) Fatal assembly error: Source is not resolvable. Errors were encountered during assembly. 2600 Basic compilation completed. Compilation completed at 2013-10-05 00:25:14 view output file:///C:/atari/Dead Road/bin Sourcecode: rem CODE INSPIRED BY Atarius Maximus at http://www.atariage.com/forums/index.php?showtopic=109288 set kernel DPC+ set kernel_options player1colors playercolors pfcolors set smartbranching on AUDV0=0 AUDV1=0 player0x = 77 player0y = 85 player1x = 77 player1y = 30 ballx = 50 bally = 30 dim _P1_L_R = player1x.a dim _P1_U_D = player1y.b dim _P0_L_R = player0x.c dim _P0_U_D = player0y.d const pfscore=1 pfscore1 = 21 pfscorecolor = $0E main ballheight = 4 CTRLPF = $21 scorecolor = $0E player0: %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00111000 %00101000 %00010000 end player0color: $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; $04; end e=e+1 rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME... if e = 16 then player1: %01100000 %00110000 %00110100 %01100110 %01100010 %01111100 %00111100 %10111001 %10011001 %01011010 %00111110 %00001100 %00010010 %00011110 %00101101 %00011110 end if e = 16 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 32 then player1: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if e = 32 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 48 then player1: %00000011 %00000110 %00100110 %01100011 %01000011 %00111110 %00111100 %00011100 %00011000 %10011001 %11111111 %00110000 %01001000 %01001000 %10110100 %01111000 end if e = 48 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 64 then player1: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if e = 64 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e=64 then e=0 s=s+1 rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME... if s = 16 then player2: %01100000 %00110000 %00110100 %01100110 %01100010 %01111100 %00111100 %10111001 %10011001 %01011010 %00111110 %00001100 %00010010 %00011110 %00101101 %00011110 end if s = 32 then player2: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if s = 48 then player2: %00000011 %00000110 %00100110 %01100011 %01000011 %00111110 %00111100 %00011100 %00011000 %10011001 %11111111 %00110000 %01001000 %01001000 %10110100 %01111000 end if s = 64 then player2: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if s=64 then s=0 pfcolors: $04 $04 $04 $D2 $20 $20 $22 $22 $24 $24 $26 end playfield: .....XX.X...XXX......X...XX..... .XX..XX.X.X.XXX..X.X.XX..XX.X.X. .XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX ................................ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX end drawscreen if joy0right then _P0_L_R = _P0_L_R + 0.50 if joy0left then _P0_L_R = _P0_L_R - 0.50 if _P1_U_D < _P0_U_D then _P1_U_D = _P1_U_D + 0.15 if _P1_U_D > _P0_U_D then _P1_U_D = _P1_U_D - 0.15 if player0x = player1x && joy0fire then player1y = 30 : player1x = rand : score = score + 10 : n = 11 if player1y = player0y then o = 11 : player1x = rand : player1y = 30 : player0y = 85 : pfscore1 = pfscore1/4 if player1x < 50 then player1x = rand if player1x > 135 then player1x = rand if n > 0 then AUDV0 = 15 : AUDC0 = 8 : AUDF0 = 30 : n = n - 1: if n = 0 then AUDV0 = 0 if o > 0 then AUDV0 = 15 : AUDC0 = 7 : AUDF0 = 25 : o = o - 1: if o = 0 then AUDV0 = 0 goto main
  12. Awesome! Hm, I do have a question about multisprites in DPC+ Player1 is set up like this; e=e+1 rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME... if e = 16 then player1: %01100000 %00110000 %00110100 %01100110 %01100010 %01111100 %00111100 %10111001 %10011001 %01011010 %00111110 %00001100 %00010010 %00011110 %00101101 %00011110 end if e = 16 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 32 then player1: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if e = 32 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 48 then player1: %00000011 %00000110 %00100110 %01100011 %01000011 %00111110 %00111100 %00011100 %00011000 %10011001 %11111111 %00110000 %01001000 %01001000 %10110100 %01111000 end if e = 48 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 64 then player1: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if e = 64 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e=64 then e=0 Do I simply need to copy this and rename it player2 instead of player1? Maybe multisprites can't be multicolored?
  13. Okay, I managed to get it working =D
  14. Yeah, I haven't added diagonal movement yet. I need to get movement working first before I add anything new =) The source code is here: rem CODE INSPIRED BY Atarius Maximus at http://www.atariage.com/forums/index.php?showtopic=109288 set kernel_options player1colors playercolors pfcolors set smartbranching on AUDV0=0 AUDV1=0 player0x = 77 player0y = 85 ballx = 50 bally = 30 player1x = 77 player1y = 31 dim _P1_L_R = player1x.a dim _P1_U_D = player1y.b const pfscore=1 pfscore1 = 21 pfscorecolor = $0E main ballheight = 4 CTRLPF = $21 scorecolor = $0E f=f+1 rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME... if f = 15 then player0: %00000100 %00100110 %01100100 %00111100 %00011000 %10111100 %11111110 %01100111 %00011001 %00011001 end if f = 15 then player0color: $20; $20; $20; $20; $FA; $E4; $E4; $E4; $02; $02; end if f = 30 then player0: %00100000 %01100100 %00100110 %00111100 %00011000 %10111100 %11111110 %01100111 %00011001 %00011001 end if f = 30 then player0color: $20; $20; $20; $20; $FA; $E4; $E4; $E4; $02; $02; end if f=30 then f=0 e=e+1 rem POSSIBLY INEFFICIENT CODE, SEPARATE COLOR INFO FOR EACH FRAME... if e = 16 then player1: %01100000 %00110000 %00110100 %01100110 %01100010 %01111100 %00111100 %10111001 %10011001 %01011010 %00111110 %00001100 %00010010 %00011110 %00101101 %00011110 end if e = 16 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 32 then player1: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if e = 32 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 48 then player1: %00000011 %00000110 %00100110 %01100011 %01000011 %00111110 %00111100 %00011100 %00011000 %10011001 %11111111 %00110000 %01001000 %01001000 %10110100 %01111000 end if e = 48 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e = 64 then player1: %00000000 %00100110 %00010100 %00100110 %01100110 %00111100 %00111100 %00111100 %10011001 %11011011 %00111100 %00011000 %00100100 %00111100 %01011010 %00111100 end if e = 64 then player1color: $E6; $E6; $E4; $A4; $A6; $A6; $E4; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; $E6; end if e=64 then e=0 pfcolors: $0E $04 $20 $20 $0E $04 $20 $20 $0E $0E $0E end playfield: ................................ .....XX........XX........XX..... .....XX........XX........XX..... .....XX........XX........XX..... ................................ ..........XX........XX.......... ..........XX........XX.......... ..........XX........XX.......... ................................ ................................ ................................ end drawscreen if joy0right then ballx = ballx + 1 if joy0left then ballx = ballx - 1 if joy0up then bally = bally - 1 if joy0down then bally = bally + 1 if _P1_U_D < player0y then _P1_U_D = _P1_U_D + 0.25 if _P1_U_D > player0y then _P1_U_D = _P1_U_D - 0.25 if collision(ball,player1) && joy0fire then t = (rand&7) : score = score + 10 : n = 11 if t = 0 then player1x = 77 : player1y = 31 if t = 1 then player1x = 37 : player1y = 31 if t = 2 then player1x = 117 : player1y = 31 if t = 3 then player1x = 57 : player1y = 63 if t = 4 then player1x = 97 : player1y = 63 if n > 0 then AUDV0 = 15 : AUDC0 = 8 : AUDF0 = 30 : n = n - 1: if n = 0 then AUDV0 = 0 goto main
  15. On a related question. I don't really know how to combine random placement of player1 with movement of player1. Let's say this code makes player1 go to a randomly chosen location when colliding with ball and while joy0fire is pressed. if collision(ball,player1) && joy0fire then t = (rand&7) : score = score + 10 : n = 11 if t = 0 then player1x = 77 : player1y = 31 if t = 1 then player1x = 37 : player1y = 31 if t = 2 then player1x = 117 : player1y = 31 if t = 3 then player1x = 57 : player1y = 63 if t = 4 then player1x = 97 : player1y = 63 if n > 0 then AUDV0 = 15 : AUDC0 = 8 : AUDF0 = 30 : n = n - 1: if n = 0 then AUDV0 = 0 But I want player1 to move downwards when one of the places has been chosen. If I add: if _P1_U_D < player0y then _P1_U_D = _P1_U_D + 0.25 Player1 bounces up and down at its current location.
  16. Ahh, cool! Many thanks! That's great =)
  17. Rabbit 2600

    A.I?

    I'm tired of having stupid enemies moving in a straight line in my games. How would I go about making them sometimes moving left or right instead of straight down? My current formula I use in all my games is as following: if _P1_U_D < player0y then _P1_U_D = _P1_U_D + 0.25 if _P1_U_D > player0y then _P1_U_D = _P1_U_D - 0.25
  18. Hm, very interesting idea! Not sure if my skills are up for it but I'll try and see what I can do =) I definetly need things to keep the game interesting :3
  19. Rabbit 2600

    DPC+?

    Where can I get my hands on DPC+?
  20. agreed. I'm fiddling with the fine tunings.
  21. Sorry for not explaining things properly. The d counter determines whether player1 will end up on the left or the right side of player0. Many thanks for all the help, your coding skills are extremely good =)
×
×
  • Create New...