Jump to content
IGNORED

how to calculate pfpixel coordinates (playfield 32 rows)


Erik Zimmermann

Recommended Posts

Move joystick to draw. Hold fire button to erase while moving joystick. Press reset switch to clear the screen.

 

Here's the .bas file:

a1_2022y_02m_02d_1220t.bas

 

Here's the .bin file to use with your favorite emulator:

a1_2022y_02m_02d_1220t.bin

Link to comment
Share on other sites

I shouldn't be asking this, but.. I've gotten it wrong by trying to figure out the maths myself in the past.

 

I see this block of code that applies for 32 rows:

   ;***************************************************************
   ;
   ;  Playfield drawing and erasing.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  Converts sprite coordinates to playfield coordinates.
   ;
   temp5 = (player1x-13)/4

   temp6 = (player1y)/3

 

What is the version for regular old (non SARA RAM) 12 rows?

 

 

Link to comment
Share on other sites

14 minutes ago, Gemintronic said:

I shouldn't be asking this, but.. I've gotten it wrong by trying to figure out the maths myself in the past.

 

I see this block of code that applies for 32 rows:


   ;***************************************************************
   ;
   ;  Playfield drawing and erasing.
   ;
   ;```````````````````````````````````````````````````````````````
   ;  Converts sprite coordinates to playfield coordinates.
   ;
   temp5 = (player1x-13)/4

   temp6 = (player1y)/3

 

What is the version for regular old (non SARA RAM) 12 rows?

 

 

 

I think I already have it figured out in the Collision Prevention example programs:

 

https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#expro_collision

 

It's something like this:

   temp5 = (player0x-10)/4

   temp6 = (player0y-9)/8

 

But the numbers you subtract usually have to change depending on the sprite and what you want it to do.

  • Thanks 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...
  • Recently Browsing   0 members

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