Jump to content
IGNORED

One long sprite made up of all the pixels


atari2600land
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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.)

  • Like 1
Link to comment
Share on other sites

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

  • Like 1
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...
 Share

  • Recently Browsing   0 members

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