Jump to content

Photo

pfpixel to regular pixel conversion?


2 replies to this topic

#1 Lillapojkenpćön OFFLINE  

Lillapojkenpćön

    Chopper Commander

  • 180 posts

Posted Sun Jan 27, 2019 2:40 PM

After I've got the closest pfpixel value in var1

 

  var1 = (ballx-18)/4

 

can I convert it back to a regular position?

If i now want the ball to exactly line up or overlap that pfpixel.

 

 I could do it with a table indexed by var1

 but if there's some + something * something calculation that would be alot easier.

 

 

 SOLVED

 

 ballx=(var1*4)+17


Edited by Lillapojkenpćön, Sun Jan 27, 2019 2:47 PM.


#2 Gemintronic OFFLINE  

Gemintronic

    Jason S. - Lead Developer & CEO

  • 9,308 posts

Posted Wed Jan 30, 2019 12:57 PM

Of course, depending on which section of the screen your var is it may be reversed.  Bogax made a function with DATA tables that flipped the values around in that case.  I used it in my Rat Race mock up here:

http://atariage.com/forums/topic/218190-smooth-vertical-scrolling-from-data-want-4-way/ 

 

R.T.s explanation of why some vars values are reversed:

http://www.randomter....html#playfield



#3 Lillapojkenpćön OFFLINE  

Lillapojkenpćön

    Chopper Commander

  • Topic Starter
  • 180 posts

Posted Wed Jan 30, 2019 1:44 PM

Hmm, do I need to worry about that with the DPC+ kernel? the horisontal pfpixel positions are 0-31 in correct order, it has worked perfectly so far.

 

On a side note I think DPC+ uses the vars to, I renamed a freed up variable to "var10" and after leaving my game on over the night it had two columns of pfpixels turned on, exactly where var10 is located on RT's chart, it got me thinking of how many extra variables you could possibly get if that's the case, if your background and playfield colors are the same it wouldn't matter if pfpixels where turning on and of, you wouldn't see it.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users