Jump to content

Photo

One long sprite made up of all the pixels


4 replies to this topic

#1 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • 11,026 posts
  • Location:Salem, Oregon

Posted Sat Feb 10, 2018 10:26 AM

So I am making a game where the player gets beamed up, and there's the classic light beam ray that comes down and picks the player up and beams him up. But surely there must be a better way to do it than this:

please_end_level
  if player0y=200 && joy0fire then goto game_main
  if player0y=200 then l{0}=0 : goto title_screen
 
 player1:
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
  %11111111
end

  player1color:
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
  $1A
end


 if !missile1x{0} then player1height=player1height+1 : player1y=player1y+1

 temp6=player0y+3

 if !missile1x{0} && player1y=temp6 then missile1x{0}=1
 if missile1x{0} && player0y<>200 then player0y=player0y-1

  goto game_main

 

Can I use the player1pointers in this case, or do I have to do it like this?



#2 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,026 posts
  • Location:Salem, Oregon

Posted Sat Feb 10, 2018 11:55 AM

I did some fooling around and this seems to work good:

please_end_level
  if player0y=200 && joy0fire then goto game_main
  if player0y=200 then l{0}=0 : goto title_screen
 
  player1pointerlo=1

  player1pointerhi=255

  COLUP1=$1A


 if !missile1x{0} then player1height=player1height+1 : player1y=player1y+1

 temp6=player0y+2

 if !missile1x{0} && player1y=temp6 then missile1x{0}=1
 if missile1x{0} && player0y<>200 then player0y=player0y-1

  goto game_main

 (I'm using missile1x{0} since I ran out of variables.)



#3 kdgarris OFFLINE  

kdgarris

    Chopper Commander

  • 236 posts

Posted Sat Feb 10, 2018 1:59 PM

Awesome!  I didn't know that adding to playerXheight would copy any rows like that.  That could be a handy trick.  Did you still have to define the colors of the rows that weren't yet in existence, presumably?



#4 atari2600land OFFLINE  

atari2600land

    Channel F Viewer

  • Topic Starter
  • 11,026 posts
  • Location:Salem, Oregon

Posted Sat Feb 10, 2018 2:29 PM

Yes, I did. So I got rid of player1colors and just made it one color.



#5 CurtisP OFFLINE  

CurtisP

    Chopper Commander

  • 249 posts

Posted Mon Feb 12, 2018 7:47 PM

Awesome!  I didn't know that adding to playerXheight would copy any rows like that.  That could be a handy trick.  Did you still have to define the colors of the rows that weren't yet in existence, presumably?

 

There isn't any copying of rows happening. All that changing playerXheight does is make the player taller ot shorter. 

 

The reason the player is solid pixels is because settng player1pointerlo to 1 and player1pointerhi to 255 makes the player data point to location 65280 ($FF00) which is at the end of the catridge ROM and the compile just happens to fill unused space with 255's ($FF). If the compiled code ever exceeds 3,584 bytes, then you will the player will contain apparently random patterns.

 

As for the colors, I'm assuming that the example posted used the single-color player option. If multi-color were enabled, the all the lines of the player would be color $FF, or white.

 

  COLUP1=$1A






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users