Jump to content


vblank object positioning issue

3 replies to this topic

#1 kdgarris OFFLINE  



  • 333 posts

Posted Mon Mar 5, 2018 9:33 AM

I have noticed that objects positioned within vblank jump around the screen before reaching their destination.  I have written a small test program to show this behavior.  Hit fire to reposition the ball on the screen randomly.



Attached File  vblank.bas   825bytes   171 downloads


Attached File  vblank.bas.bin   2KB   18 downloads

#2 ZackAttack OFFLINE  



  • 711 posts
  • Location:Orlando, FL US

Posted Mon Mar 5, 2018 1:43 PM

Looks like you keep selecting a new random position each frame that the button is held down. Have you tried adding some additional logic so the reposition only happens when the button is pressed and was previously not pressed? Even a fast button press is going to span a few frames, which would cause what you're seeing.

#3 kdgarris OFFLINE  



  • Topic Starter
  • 333 posts

Posted Mon Mar 5, 2018 2:28 PM

I think my original version accounted for that, but I attached an updated version that makes that logic more clear.

#4 Random Terrain OFFLINE  

Random Terrain

    Visual batari Basic User

  • 28,688 posts
  • Controlled Randomness
    Replay Value
  • Location:North Carolina (USA)

Posted Mon Mar 5, 2018 5:59 PM

Looks like it moves up or down to the new y position, then left or right to the new x position. It's really noticeable if you move it between two positions:


Attached File  vblank_2018y_03m_05d_1855t.bas   1.6KB   8 downloads


Attached File  vblank_2018y_03m_05d_1855t.bin   2KB   13 downloads


0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users