Jump to content
IGNORED

Question with PF color


STGraves

Recommended Posts

Hello, I've got one question, is there a way to keep fixed the colors in the playfield?, in my game I'm currently using pfscroll and as the screen moves the colors too change from one line to the next, and I wonder is there a way to keep the color fixed in the same line, scrolling with the playfield simultaneously?

thanks

Link to comment
Share on other sites

Emmm, it turns out that I don't know the exact code for that, can you please tell me the command?, because I only added the line playfieldpos=8 nothing else.

Then that's why it didn't work. Like I said, you'd change the playfield colors every time playfieldpos=8, so that means checking if playfieldpos is equal to 8, then displaying the correct batch of playfield colors.

 

It would look kind of like this:

 

   if playfieldpos <> 8 then goto __Skip_PF_Color_Change

   on _PFColor_Counter goto __PFC00 __PFC01 __PFC02 __PFC03 __PFC04 . . .

   _PFColor_Counter = _PFColor_Counter + 1

   if _PFColor_Counter >= [whatever the limit is] then _PFColor_Counter = 0

__Skip_PF_Color_Change



   [This section would be outside of your main loop]


__PFC00

   pfcolors:
   $50
   $52
   $56
   $58
   $5A
   $5C
   $5E
   $6C
   $6A
   $68
   $66
   $62
   $60
end

   goto __Skip_PF_Color_Change



__PFC01

   pfcolors:
   $60
   $50
   $52
   $56
   $58
   $5A
   $5C
   $5E
   $6C
   $6A
   $68
   $66
   $62
end

   goto __Skip_PF_Color_Change


   [And you'd continue with the rest of the color changing code here.]


Link to comment
Share on other sites

Search your code for "pfcolors:" and make sure all of them are indented.

The code I said to put outside of your main loop goes here:

   ;***************************************************************
   ;
   ;  Reset switch check and end of main loop.
   ;
   ;  Any Atari 2600 program should restart when the reset  
   ;  switch is pressed. It is part of the usual standards
   ;  and procedures.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If the reset switch is not pressed, turn off reset
   ;  restrainer bit and skip this subsection.
   ;
   if !switchreset then _Bit0_Reset_Restrainer{0} = 0 : goto __Main_Loop

   ;```````````````````````````````````````````````````````````````
   ;  If the reset switch hasn't been released since starting the
   ;  game, skip this subsection.
   ;
   if _Bit0_Reset_Restrainer{0} then goto __Main_Loop

   ;```````````````````````````````````````````````````````````````
   ;  Clears the GAME OVER bit so the title screen will appear.
   ;
   _Bit2_Game_Over{2} = 0

   ;```````````````````````````````````````````````````````````````
   ;  Reset pressed appropriately. Restart the program.
   ;
   goto __Start_Restart




   ;***************************************************************
   ;
   ;  PUT THE CODE YOU ARE GOTOING HERE.
   ;  THIS IS OUTSIDE OF YOUR MAIN LOOP.
   ;
   ;***************************************************************



   ;***************************************************************
   ;
   ;  Thomas animation frames.
   ;
__Tom00
 player1:
 %11100111
 %01100110
 %01100110
 %00111100
 %11011011
 %10100101
 %11011011
 %11011011
 %01011010
 %00011100
 %00110000
 %01111011
 %01010110
 %00010100
 %01111111
 %00111100
end
   goto __Thomas_Frame_Done
Link to comment
Share on other sites

Ok I did just that, it compiles correctly but when I try to run it for some reason only a black screen pops out with a buzzing noise, here are both the code and the .bas file

   ;****************************************************************
   ;
   ;  E.T.'s Revenge
   ;
   ;  Stop E.T. from conquering the world.
   ;
   ;***************************************************************


   ;***************************************************************
   ;
   ;  Kernel options.
   ;
   set kernel_options player1colors pfcolors no_blank_lines


   ;***************************************************************
   ;
   ;  Variable aliases go here (DIMs).
   ;
   ;  You can have more than one alias for each variable.
   ;  If you use different aliases for bit operations, it is
   ;  easier to understand and remember what they do.
   ;
   ;```````````````````````````````````````````````````````````````

   ;```````````````````````````````````````````````````````````````
   ;  _Master_Counter can be used for many things, but it is 
   ;  really useful for animating sprite frames when used
   ;  with _Frame_Counter.
   ;
   dim _Master_Counter = a
   dim _Frame_Counter = b

   ;```````````````````````````````````````````````````````````````
   ;  Sound variables.
   ;
   dim _Sound0 = c
   dim _SoundCounter0 = d
   dim _C0 = e
   dim _V0 = f
   dim _F0 = g

   ;```````````````````````````````````````````````````````````````
   ;  Converts 6 digit score to 3 sets of two digits.
   ;
   ;  The 100 thousands and 10 thousands digits are held by sc1.
   ;  The thousands and hundreds digits are held by sc2.
   ;  The tens and ones digits are held by sc3.
   ;
   dim sc1 = score
   dim sc2 = score+1
   dim sc3 = score+2

   ;```````````````````````````````````````````````````````````````
   ;  These can be used for other things using different aliases,
   ;  but for the GAME OVER loop, they are used to temporarily 
   ;  remember the score for the 2 second score/high score flip.
   ;
   dim _Temp_Score01 = s
   dim _Temp_Score02 = t
   dim _Temp_Score03 = u

   ;```````````````````````````````````````````````````````````````
   ;  Remembers the high score until the game is turned off.
   ;
   dim _High_Score01 = v
   dim _High_Score02 = w
   dim _High_Score03 = x

   ;```````````````````````````````````````````````````````````````
   ;  All-purpose bits for various jobs.
   ;
   dim _BitOp_All_Purpose_01 = y
   dim _Bit0_Reset_Restrainer = y
   dim _Bit1_FireB_Restrainer = y
   dim _Bit2_Game_Over = y
   dim _Bit3_Swap_Scores = y
   dim _Bit7_Last_Life = y

   ;```````````````````````````````````````````````````````````````
   ;  Makes better random numbers. 
   ;
   dim rand16 = z



   ;***************************************************************
   ;
   ;  Turns on pfscore bars.
   ;
   const pfscore = 1





   ;***************************************************************
   ;***************************************************************
   ;
   ;  PROGRAM START/RESTART
   ;
   ;
__Start_Restart


   ;***************************************************************
   ;
   ;  Clears the screen.
   ;
   pfclear


   ;***************************************************************
   ;
   ;  Mutes volume of both sound channels.
   ;
   AUDV0 = 0 : AUDV1 = 0


   ;***************************************************************
   ;
   ;  Clears 21 of the normal 26 variables (fastest way).
   ;  Do not clear v, w, x, y, or z in this program. The variables
   ;  v through x remember the high score. The variable y holds a
   ;  bit that should not be cleared. The variable z is used for
   ;  random numbers in this program and clearing it would mess
   ;  up those random numbers.
   ;
   a = 0 : b = 0 : c = 0 : d = 0 : e = 0 : f = 0 : g = 0 : h = 0 : i = 0
   j = 0 : k = 0 : l = 0 : m = 0 : n = 0 : o = 0 : p = 0 : q = 0 : r = 0
   s = 0 : t = 0 : u = 0


   ;***************************************************************
   ;
   ;  Clears 7 of the 8 All_Purpose_01 bits.
   ;
   ;  Bit 2 is not cleared because _Bit2_Game_Over{2} is used
   ;  to control how the program is reset.
   ;
   _BitOp_All_Purpose_01 = _BitOp_All_Purpose_01 & %00000100


   ;***************************************************************
   ;
   ;  Makes sure sprites and missile are off the screen.
   ;
   player1y = 200 : player0y = 200 : bally = 200


   ;***************************************************************
   ;
   ;  Skips title screen if game has been played and player
   ;  presses fire button or reset switch at the end of the game.
   ;
   if _Bit2_Game_Over{2} then goto __Main_Loop_Setup





   ;***************************************************************
   ;***************************************************************
   ;
   ;   TITLE SCREEN SETUP
   ;
   ;
__Setup_Title_Screen


   ;***************************************************************
   ;
   ;  Clears lives and sets score color.
   ;
   pfscore1 = 0 : score = 2015 : scorecolor = $BE


   ;***************************************************************
   ;
   ;  Sets title screen background color.
   ;
   COLUBK = $60


   ;***************************************************************
   ;
   ;  Restrains the reset switch.
   ;
   ;  This bit fixes it so the reset switch becomes inactive if
   ;  it hasn't been released after entering a different segment
   ;  of the program. It does double duty by restraining the
   ;  fire button too in the title screen loop.
   ;
   _Bit0_Reset_Restrainer{0} = 1


   ;***************************************************************
   ;
   ;  Makes sure playfield is back to normal.
   ;
   playfieldpos = 8


   ;***************************************************************
   ;
   ;  Sets up title screen playfield.
   ;
   playfield:
   .......XXX..XXX.X..XX...........
   .......X.....X..X.X..X..........
   .......XX....X.....X............
   .......X.....X...X..X...........
   .......XXX.X.X.X..XX............
   ................................
   XXX..XXX.X.X.XXX.X..X..XXX.XXX..
   X..X.X...X.X.X...XX.X.X....X....
   X..X.XX..X.X.XX..X.XX.X.XX.XX...
   XXX..X...X.X.X...X..X.X..X.X....
   X..X.XXX..X..XXX.X..X..XXX.XXX..
end





   ;***************************************************************
   ;***************************************************************
   ;
   ;  TITLE SCREEN LOOP
   ;
   ;
__Title_Screen_Loop



   ;***************************************************************
   ;
   ;  Sets title screen playfield pixel color.
   ;
   pfcolors:
   $C0
   $C2
   $C6
   $C8
   $CA
   $CC
   $CE
   $CC
   $CA
   $C8
   $C6
   $C2
   $C0
end



   ;***************************************************************
   ;
   ;  Displays the screen.
   ;
   drawscreen



   ;***************************************************************
   ;
   ;  Reset/fire button check and end of title screen loop.
   ;  
   ;  Starts the game if the reset switch or the fire button
   ;  is pressed appropriately.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If fire button or reset switch is not pressed, clear the 
   ;  restrainer bit and jump to beginning of title screen loop.
   ;
   if !switchreset && !joy0fire then _Bit0_Reset_Restrainer{0} = 0 : goto __Title_Screen_Loop

   ;```````````````````````````````````````````````````````````````
   ;  If reset/fire hasn't been released since starting 'title
   ;  screen' loop, jump to beginning of title screen loop.
   ;
   if _Bit0_Reset_Restrainer{0} then goto __Title_Screen_Loop

   ;```````````````````````````````````````````````````````````````
   ;  Reset or Fire pressed appropriately. Jump to main loop setup.
   ;
   goto __Main_Loop_Setup





   ;***************************************************************
   ;***************************************************************
   ;
   ;  MAIN LOOP SETUP
   ;
   ;

 
__Main_Loop_Setup



   ;***************************************************************
   ;
   ;  Clears the GAME OVER bit for the main loop.
   ;
   _Bit2_Game_Over{2} = 0


   ;***************************************************************
   ;
   ;  Restrains the reset switch for the main loop.
   ;
   ;  This bit fixes it so the reset switch becomes inactive if
   ;  it hasn't been released after being pressed in the title
   ;  screen section or the GAME OVER section. If the reset
   ;  switch isn't being held down, this bit will be cleared
   ;  in the main loop.
   ;
   _Bit0_Reset_Restrainer{0} = 1


   ;***************************************************************
   ;
   ;  Restrains the fire button for the main loop.
   ;
   ;  This bit fixes it so the fire button becomes inactive if it
   ;  hasn't been released after being pressed in the title
   ;  screen section or the GAME OVER section. If the fire
   ;  button isn't being held down, this bit will be cleared
   ;  in the main loop.
   ;
   _Bit1_FireB_Restrainer{1} = 1


   ;***************************************************************
   ;
   ;  Starting position of player0 (Thomas).
   ;
   player1x = 74 : player1y = 78


   ;***************************************************************
   ;
   ;  Starting position of player0 (E.T.).
   ;
   player0x = (rand/2) + (rand&15) : player0y = 0 


   ;***************************************************************
   ;
   ;  Defines ball height and location.
   ;
   ballheight = 4 : bally = 250


   ;***************************************************************
   ;
   ;  Sets background color.
   ;
    COLUBK = $F0


   ;***************************************************************
   ;
   ;  Sets score and score color.
   ;
   score = 0 : scorecolor = $1E


   ;***************************************************************
   ;
   ;  Sets number of lives and sets color.
   ;
   pfscore1 = %01010101 : pfscorecolor = $AE


   ;***************************************************************
   ;
   ;  Sets up the main loop playfield.
   ;

 playfield:
 ...........X.......X............
 ...........X.......X............
 ...........X.......X............
 ...........X.......X............
 XXXXXXXXXXXX.......XXXXXXXXXXXXX
 ................................
 ................................
 ................................
 XXXXXXXXXXXX.......XXXXXXXXXXXXX
 ...........X.......X............
 ...........X.......X............
 ...........X.......X............
end



   ;***************************************************************
   ;***************************************************************
   ;
   ;  MAIN LOOP (MAKES THE GAME GO)
   ;
   ;


 CTRLPF = $31
 ballheight = 8

__Main_Loop




   ;***************************************************************
   ;
   ;  Sets E.T. sprite color.
   ;
   COLUP0 = $DC



   ;***************************************************************
   ;
   ;  Makes ball a little wider.
   ;
   NUSIZ0 = $35



   ;***************************************************************
   ;
   ;  Animation counters.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  Increments _Master_Counter.
   ;
   _Master_Counter = _Master_Counter + 1

   ;```````````````````````````````````````````````````````````````
   ;  Skips this subsection if _Master_Counter is less than 7.
   ;
   if _Master_Counter < 7 then goto __Skip_Counters

   ;```````````````````````````````````````````````````````````````
   ;  Increments _Frame_Counter and clears _Master_Counter.
   ;
   _Frame_Counter = _Frame_Counter + 1 : _Master_Counter = 0

   ;```````````````````````````````````````````````````````````````
   ;  Clears _Frame_Counter if it is greater than 3.
   ;
   if _Frame_Counter > 3 then _Frame_Counter = 0

__Skip_Counters





   ;***************************************************************
   ;
   ;  Thomas animation (4 frames, 0 through 3).
   ;
   on _Frame_Counter goto __Tom00 __Tom01 __Tom02 __Tom03

__Thomas_Frame_Done

   ;***************************************************************
   ;
   ;  E.T animation (4 frames, 0 through 3).
   ;
   on _Frame_Counter goto __ET00 __ET01 __ET02 __ET03

__ET_Frame_Done



   ;***************************************************************
   ;
   ;  ball check and fire button check.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If ball is off the screen, jump to fire button check.
   ;
   if bally > 240 then goto __FireB_Check

   ;```````````````````````````````````````````````````````````````
   ;  Moves ball and skips fire button check.
   ;
   bally = bally - 2 : goto __Skip_FireB

__FireB_Check

   ;```````````````````````````````````````````````````````````````
   ;  Checks fire button since ball is off the screen.
   ;  If fire button is not pressed, skip this subsection.
   ;
   if !joy0fire then _Bit1_FireB_Restrainer{1} = 0 : goto __Skip_FireB

   ;```````````````````````````````````````````````````````````````
   ;  If fire button hasn't been released since title screen,
   ;  skip this subsection.
   ;
   if _Bit1_FireB_Restrainer{1} then goto __Skip_FireB

   ;```````````````````````````````````````````````````````````````
   ;  Starts the firing of ball.
   ;
   bally = player1y - 16 : ballx = player1x + 4

__Skip_FireB



   ;***************************************************************
   ;
   ;  Joystick movement check.
   ;
   if joy0up then player1y = player1y - 1 : pfscroll down
   if joy0down then player1y = player1y + 1 : pfscroll up
   if joy0left then player1x = player1x - 1 : pfscroll right
   if joy0right then player1x = player1x + 1 : pfscroll left



   ;***************************************************************
   ;
   ;  Keeps player1 within screen borders.
   ;
   if player1x < 3 then player1x = 3
   if player1x > 150 then player1x = 150
   if player1y < 20 then player1y = 20
   if player1y > 84 then player1y = 84



   ;***************************************************************
   ;
   ;  E.T. chases the player.
   ;
   if player0y < player1y then player0y = player0y + 1
   if player0y > player1y then player0y = player0y - 1
   if player0x < player1x then player0x = player0x + 1
   if player0x > player1x then player0x = player0x - 1



   ;***************************************************************
   ;
   ;  E.T./ball collision check.
   ;
   if !collision(ball,player0) then goto __Skip_ET_Kill

   ;```````````````````````````````````````````````````````````````
   ;  Adds 1 to the score.
   ;
   score = score + 1

   ;```````````````````````````````````````````````````````````````
   ;  Sound effect 1 setup.
   ;
   if _Sound0 then goto __Skip_Sound0_Setup

   _Sound0 = 1 : _SoundCounter0 = 10

   _C0 = 4 : _V0 = 12 : _F0 = 14

   temp5 = 255 : if player0y < player1y then temp5 = player1y - player0y

   if temp5 < 30 then _C0 = 12 ; Makes a different sound when closer to player.

__Skip_Sound0_Setup

   ;```````````````````````````````````````````````````````````````
   ;  Moves E.T. to new location and removes missile.
   ;
   player0x = (rand/2) + (rand&15) : player0y = 0 : bally = 250

__Skip_ET_Kill



   ;***************************************************************
   ;
   ;  E.T./Thomas collision check.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  if no collision between sprites, skip this subsection.
   ;
   if !collision(player0,player1) then goto __Skip_Players_Touch

   ;```````````````````````````````````````````````````````````````
   ;  Subtracts 1 from the score.
   ;
   if sc3 > 0 then score = score - 1

   ;```````````````````````````````````````````````````````````````
   ;  if pfscore1 bar is empty, activate last life bit.
   ;
   if !pfscore1 then _Bit7_Last_Life{7} = 1 

   ;```````````````````````````````````````````````````````````````
   ;  Deletes a life.
   ;
   if pfscore1 then pfscore1 = pfscore1/4

   ;```````````````````````````````````````````````````````````````
   ;  Moves E.T. to new location and removes missile.
   ;
   player0x = (rand/2) + (rand&15) : player0y = 0 : bally = 250

   ;```````````````````````````````````````````````````````````````
   ;  Sound effect 2 setup.
   ;
   if _Sound0 then goto __Skip_Players_Touch

   _Sound0 = 2 : _SoundCounter0 = 10

   _C0 = 7 : _V0 = 12 : _F0 = 12

__Skip_Players_Touch



   ;***************************************************************
   ;
   ;  Point sound.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If the sound isn't on, skip this subsection.
   ;
   if _Sound0 <> 1 then goto __Skip_Sound1

   ;```````````````````````````````````````````````````````````````
   ;  Flips the frequency between 11 and 14.
   ;
   _F0 = _F0 ^ 5

   ;```````````````````````````````````````````````````````````````
   ;  Sets the tone, volume and frequency.
   ;
   AUDC0 = _C0 : AUDV0 = _V0 : AUDF0 = _F0

   ;```````````````````````````````````````````````````````````````
   ;  Decreases volume by 1 and makes sure it doesn't go below 2.
   ;
   _V0 = _V0 - 1 : if _V0 < 2 then _V0 = 2

   ;```````````````````````````````````````````````````````````````
   ;  Decreases the sound counter.
   ;
   _SoundCounter0 = _SoundCounter0 - 1

   ;```````````````````````````````````````````````````````````````
   ;  If sound counter is zero, clear _Sound0 and mute channel.
   ;
   if !_SoundCounter0 then _Sound0 = 0 : AUDV0 = 0

__Skip_Sound1




   ;***************************************************************
   ;
   ;  E.T. touches Thomas sound.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If the sound isn't on, skip this subsection.
   ;
   if _Sound0 <> 2 then goto __Skip_Sound2

   ;```````````````````````````````````````````````````````````````
   ;  Sets the tone, volume and frequency.
   ;
   AUDC0 = _C0 : AUDV0 = _V0 : AUDF0 = _F0

   ;```````````````````````````````````````````````````````````````
   ;  Decreases volume by 1 and makes sure it doesn't go below 2.
   ;
   _V0 = _V0 - 1 : if _V0 < 2 then _V0 = 2

   ;```````````````````````````````````````````````````````````````
   ;  Decreases the sound counter.
   ;
   _SoundCounter0 = _SoundCounter0 - 1

   ;```````````````````````````````````````````````````````````````
   ;  If sound counter is zero, clear _Sound0 and mute channel.
   ;  Also tells game to end if last life is lost.
   ;
   if !_SoundCounter0 then _Sound0 = 0 : AUDV0 = 0 : if _Bit7_Last_Life{7} then _Bit2_Game_Over{2} = 1

__Skip_Sound2



   ;***************************************************************
   ;
   ;  Sets player1 color.
   ;
 player1color:
 $26
 $26
 $44
 $44
 $2A
 $2A
 $26
 $44
 $26
 $2A
 $2A
 $2A
 $2A
 $2A
 $44
 $44
end




   ;***************************************************************
   ;
   ;  Sets main loop playfield pixel color.
   ;

__PFC00

   pfcolors:
   $50
   $52
   $56
   $58
   $5A
   $5C
   $5E
   $6C
   $6A
   $68
   $66
   $62
   $60
end

   goto __Skip_PF_Color_Change



__PFC01

   pfcolors:
   $60
   $50
   $52
   $56
   $58
   $5A
   $5C
   $5E
   $6C
   $6A
   $68
   $66
   $62
end

   goto __Skip_PF_Color_Change

__PFC02

  pfcolors:
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
  $66
end

   goto __Skip_PF_Color_Change

__PFC03

  pfcolors:
  $66
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
end

   goto __Skip_PF_Color_Change

__PFC04

  pfcolors:
  $68
  $66
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
end

   goto __Skip_PF_Color_Change

__PFC05

  pfcolors:
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
  $5C
  $5E
  $6C
end

   goto __Skip_PF_Color_Change

__PFC06

  pfcolors:
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
  $5C
  $5E
end

   goto __Skip_PF_Color_Change

__PFC07

  pfcolors:
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
  $5C
end

   goto __Skip_PF_Color_Change

__PFC08

  pfcolors:
  $5C
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
  $56
  $58
  $5A
end

   goto __Skip_PF_Color_Change

__PFC09

  pfcolors:
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
  $56
  $58
end

   goto __Skip_PF_Color_Change

__PFC10

  pfcolors:
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
  $56
end

   goto __Skip_PF_Color_Change

__PFC11

  pfcolors:
  $56
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
  $52
end

   goto __Skip_PF_Color_Change

__PFC12

  pfcolors:
  $52
  $56
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
  $50
end

   goto __Skip_PF_Color_Change

__PFC13

  pfcolors:
  $50
  $52
  $56
  $58
  $5A
  $5C
  $5E
  $6C
  $6A
  $68
  $66
  $62
  $60
end

   goto __Skip_PF_Color_Change

   ;***************************************************************
   ;
   ;  Displays the screen.
   ;
   drawscreen



   ;***************************************************************
   ;
   ;  Checks to see if the game is over.
   ;
   if _Bit2_Game_Over{2} then goto __Game_Over_Setup



   ;***************************************************************
   ;
   ;  Reset switch check and end of main loop.
   ;
   ;  Any Atari 2600 program should restart when the reset  
   ;  switch is pressed. It is part of the usual standards
   ;  and procedures.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If the reset switch is not pressed, turn off reset
   ;  restrainer bit and skip this subsection.
   ;
   if !switchreset then _Bit0_Reset_Restrainer{0} = 0 : goto __Main_Loop

   ;```````````````````````````````````````````````````````````````
   ;  If the reset switch hasn't been released since starting the
   ;  game, skip this subsection.
   ;
   if _Bit0_Reset_Restrainer{0} then goto __Main_Loop

   ;```````````````````````````````````````````````````````````````
   ;  Clears the GAME OVER bit so the title screen will appear.
   ;
   _Bit2_Game_Over{2} = 0

   ;```````````````````````````````````````````````````````````````
   ;  Reset pressed appropriately. Restart the program.
   ;
   goto __Start_Restart


   ;***************************************************************
   ;
   ;				pf color restart
   ;
   ;***************************************************************
   if playfieldpos = 8 then goto __Skip_PF_Color_Change

   on _PFColor_Counter goto __PFC00 __PFC01 __PFC02 __PFC03 __PFC04 __PFC05 __PFC06 __PFC07 __PFC08 __PFC09 __PFC10 __PFC11 __PFC12 __PFC13

   _PFColor_Counter = _PFColor_Counter + 1

   if _PFColor_Counter >= 14 then _PFColor_Counter = 0

__Skip_PF_Color_Change




   ;***************************************************************
   ;
   ;  Thomas animation frames.
   ;
__Tom00
 player1:
 %11100111
 %01100110
 %01100110
 %00111100
 %11011011
 %10100101
 %11011011
 %11011011
 %01011010
 %00011100
 %00110000
 %01111011
 %01010110
 %00010100
 %01111111
 %00111100
end
   goto __Thomas_Frame_Done


__Tom01
 player1:
 %01100000
 %11000000
 %01100011
 %00001111
 %11011101
 %11001010
 %11100100
 %01110101
 %00101011
 %00011101
 %00110000
 %01111011
 %01010110
 %00010100
 %01111111
 %00111100
end
   goto __Thomas_Frame_Done


__Tom02
 player1:
 %00000111
 %10000110
 %11110110
 %11111010
 %00111100
 %00111110
 %01001111
 %01010011
 %00101100
 %00011100
 %00110000
 %01111011
 %01010110
 %00010100
 %01111111
 %00111100
end
   goto __Thomas_Frame_Done



__Tom03
 player1:
 %00011000
 %00110010
 %00110100
 %00101110
 %01110011
 %01101101
 %01011100
 %01011010
 %00111010
 %00011100
 %00110000
 %01111011
 %01010110
 %00010100
 %01111111
 %00111100
end
   goto __Thomas_Frame_Done





   ;***************************************************************
   ;
   ;  E.T. animation frames.
   ;
__ET00
 player0:
 %01110000
 %00110111
 %00011111
 %10011111
 %11111111
 %00011111
 %00001111
 %00000011
 %11000011
 %11111111
 %10111111
 %11111100
end
   goto __ET_Frame_Done


__ET01
 player0:
 %01110000
 %00110111
 %00011111
 %10011111
 %11111111
 %00011111
 %00001111
 %00000011
 %00000011
 %00000011
 %11000011
 %11111111
 %10111111
 %11111100
end
   goto __ET_Frame_Done


__ET02
 player0:
 %00000111
 %01110011
 %00011111
 %10011111
 %11111111
 %00011111
 %00001111
 %00000011
 %00000011
 %00000011
 %00000011
 %00000011
 %11000011
 %11111111
 %10111111
 %11111100
end
   goto __ET_Frame_Done



__ET03
 player0:
 %00000111
 %01110011
 %00011111
 %10011111
 %11111111
 %00011111
 %00001111
 %00000011
 %00000011
 %00000011
 %11000011
 %11111111
 %10111111
 %11111100
end
   goto __ET_Frame_Done





   ;***************************************************************
   ;***************************************************************
   ;
   ;  GAME OVER SETUP
   ;
   ;
__Game_Over_Setup


   ;***************************************************************
   ;
   ;  Checks for a new high score.
   ;
   if sc1 > _High_Score01 then goto __New_High_Score
   if sc1 < _High_Score01 then goto __Skip_High_Score

   ;```````````````````````````````````````````````````````````````
   ;  First byte equal. Do the next test. 
   ;
   if sc2 > _High_Score02 then goto __New_High_Score
   if sc2 < _High_Score02 then goto __Skip_High_Score

   ;```````````````````````````````````````````````````````````````
   ;  Second byte equal. Do the next test. 
   ;
   if sc3 > _High_Score03 then goto __New_High_Score
   if sc3 < _High_Score03 then goto __Skip_High_Score

   ;```````````````````````````````````````````````````````````````
   ;  All bytes equal. Current score is the same as the high score.
   ;
   goto __Skip_High_Score

__New_High_Score

   ;```````````````````````````````````````````````````````````````
   ;  Saves new high score.
   ;
   _High_Score01 = sc1 : _High_Score02 = sc2 : _High_Score03 = sc3

__Skip_High_Score


   ;***************************************************************
   ;
   ;  Saves the latest score for the high score flip.
   ;
   _Temp_Score01 = sc1 : _Temp_Score02 = sc2 : _Temp_Score03 = sc3


   ;***************************************************************
   ;
   ;  Clears the counters.
   ;
   _Master_Counter = 0 : _Frame_Counter = 0


   ;***************************************************************
   ;
   ;  Makes sure sprites and missile are off the screen.
   ;
   player0y = 200 : player1y = 200 : bally = 200


   ;***************************************************************
   ;
   ;  Restrains reset switch and fire button for GAME OVER loop.
   ;
   ;  This bit fixes it so the reset switch becomes inactive if
   ;  it hasn't been released after entering a different segment
   ;  of the program. It does double duty by restraining the
   ;  fire button too in the GAME OVER loop.
   ;
   _Bit0_Reset_Restrainer{0} = 1


   ;***************************************************************
   ;
   ;  Puts playfield back to normal after all of the scrolling.
   ;
   playfieldpos = 8


   ;***************************************************************
   ;
   ;  Clears the screen.
   ;
   pfclear


   ;***************************************************************
   ;
   ;  Sets GAME OVER background color.
   ;
   COLUBK = $6E


   ;***************************************************************
   ;
   ;  Sets up GAME OVER playfield.
   ;
   playfield:
   XXX..XXX.....XX...XX..XX.XX.XXX.
   X.....X.....X..X.X..X.X.X.X.X...
   XX....X.....X....XXXX.X...X.XX..
   X.....X.....X..X.X..X.X...X.X...
   XXX.X.X.X....XX..X..X.X...X.XXX.
   ................................
   XXX...XX...XX..X..X..X.X.X......
   X..X.X..X.X..X.X.X...X.X.X......
   XXX..XXXX.X....XX....X.X.X......
   X..X.X..X.X..X.X.X..............
   XXX..X..X..XX..X..X..X.X.X......
end





   ;***************************************************************
   ;***************************************************************
   ;
   ;  GAME OVER LOOP
   ;
   ;
__Game_Over_Loop



   ;***************************************************************
   ;
   ;  Goes to title screen after 20 seconds if player does nothing.
   ;
   ;  This includes a 2 second countdown timer. Any Atari 2600
   ;  program should freeze for 2 seconds when the game is over.
   ;  It is part of the usual standards and procedures.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  Increments the master counter.
   ;
   _Master_Counter = _Master_Counter + 1

   ;```````````````````````````````````````````````````````````````
   ;  The master counter resets every 2 seconds (60 + 60 = 120).
   ;
   if _Master_Counter < 120 then goto __Skip_20_Counter

   ;```````````````````````````````````````````````````````````````
   ;  Clears the master counter after 2 seconds have gone by
   ;  and flips the Swap_Scores bit.
   ;
   _Master_Counter = 0 : _Bit3_Swap_Scores{3} = !_Bit3_Swap_Scores{3}

   ;```````````````````````````````````````````````````````````````
   ;  If the Swap_Scores bit is on, display the high score.
   ;
   if _Bit3_Swap_Scores{3} then scorecolor = $AE : sc1=_High_Score01 : sc2=_High_Score02 : sc3=_High_Score03 : goto __Skip_Flip

   ;```````````````````````````````````````````````````````````````
   ;  If the Swap_Scores bit is off, display the current score.
   ;
   scorecolor = $1C : sc1=_Temp_Score01 : sc2=_Temp_Score02 : sc3=_Temp_Score03 

__Skip_Flip

   ;```````````````````````````````````````````````````````````````
   ;  The frame counter increments every 2 seconds.
   ;
   _Frame_Counter = _Frame_Counter + 1

   ;```````````````````````````````````````````````````````````````
   ;  If _Frame_Counter reaches 10 (2 x 10 = 20 seconds), the
   ;  program resets and goes to the title screen. The GAME OVER
   ;  bit is cleared so the title screen will appear.
   ;
   if _Frame_Counter = 10 then _Bit2_Game_Over{2} = 0 : goto __Start_Restart

__Skip_20_Counter



   ;***************************************************************
   ;
   ;  Sets GAME OVER playfield pixel color.
   ;
   pfcolors:
   $80
   $82
   $84
   $86
   $88
   $8A
   $8C
   $8E
   $8C
   $8A
   $88
   $86
end



   ;***************************************************************
   ;
   ;  Displays the screen.
   ;
   drawscreen



   ;***************************************************************
   ;
   ;  Reset/fire button check and end of GAME OVER loop.
   ;  
   ;  Restarts the program if the reset switch or the fire
   ;  button is pressed appropriately.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  If the initial 2 second freeze is not over, jump to
   ;  beginning of the GAME OVER loop.
   ;
   if _Frame_Counter = 0 then goto __Game_Over_Loop

   ;```````````````````````````````````````````````````````````````
   ;  If fire button or reset switch is not pressed, clear the 
   ;  restrainer bit and jump to beginning of GAME OVER loop.
   ;
   if !switchreset && !joy0fire then _Bit0_Reset_Restrainer{0} = 0 : goto __Game_Over_Loop

   ;```````````````````````````````````````````````````````````````
   ;  If fire button hasn't been released since leaving the
   ;  main loop, jump to beginning of the GAME OVER loop.
   ;
   if _Bit0_Reset_Restrainer{0} then goto __Game_Over_Loop

   ;```````````````````````````````````````````````````````````````
   ;  Reset or Fire pressed appropriately. Restart the program.
   ;
   goto __Start_Restart

E.T.'sRevenge.bas

Link to comment
Share on other sites

What I meant from the begining is that if there is a way to stick the specific color of the line to that line on the playfield, the bottom color to the starting bottom line and as it is scrolling either up or down the color scrolling up or down with it without it being fixed to the same position in the playfield

Link to comment
Share on other sites

What I meant from the begining is that if there is a way to stick the specific color of the line to that line on the playfield, the bottom color to the starting bottom line and as it is scrolling either up or down the color scrolling up or down with it without it being fixed to the same position in the playfield

Now that the program is setup correctly, it's up to you to play with the color data to get the results that you desire.

Link to comment
Share on other sites

One thing that I did notice though is that the version of the game that provided me yesterday works exactly the same that the version of the game that didn't have that part of the code, and if I understand correctly what the playfieldpos = 8 part meant is that every time the playfield scrolls the order of the color has to change to the order of the one written in every single frame right? if that's the case it didn't work

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...