Erik Zimmermann Posted February 2, 2022 Share Posted February 2, 2022 My playfield has 32 rows. How do I calculate the coordinates for pfpixel? _paint_block e=((player1x) / : f=(player1y) / 16 pfpixel e f on a1.bas Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/ Share on other sites More sharing options...
+Random Terrain Posted February 2, 2022 Share Posted February 2, 2022 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 Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/#findComment-4997152 Share on other sites More sharing options...
Erik Zimmermann Posted February 2, 2022 Author Share Posted February 2, 2022 THANK YOU !!!! VERY COOL. 1 Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/#findComment-4997174 Share on other sites More sharing options...
+Gemintronic Posted February 2, 2022 Share Posted February 2, 2022 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? Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/#findComment-4997221 Share on other sites More sharing options...
+Random Terrain Posted February 2, 2022 Share Posted February 2, 2022 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. 1 Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/#findComment-4997234 Share on other sites More sharing options...
Erik Zimmermann Posted February 3, 2022 Author Share Posted February 3, 2022 Hello, In this example "ex_sprite_with_missile.bas", i want to fire a Missile. Paint blocks on free place or erase a exist block on the playfield. How exactly do I calculate the coordinates for the missile Bye Erik ex_sprite_with_missile.bas Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/#findComment-4997838 Share on other sites More sharing options...
+Random Terrain Posted February 3, 2022 Share Posted February 3, 2022 Have you looked at these example programs: https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_shoot_pfpixel https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#ex_sprite_missile_pfpixel_destruction More example programs are listed here: https://www.randomterrain.com/atari-2600-memories-batari-basic-commands.html#example_programs Quote Link to comment https://forums.atariage.com/topic/330714-how-to-calculate-pfpixel-coordinates-playfield-32-rows/#findComment-4997845 Share on other sites More sharing options...
Recommended Posts
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.