rfunes Posted May 26, 2022 Share Posted May 26, 2022 (edited) Hi Friends, I update my player0x and player0y variables in inside the VBLANK session. I do this as my code is complex and using VBLANK has been great to avoid going over the cycle limit. I noticed that when my player0 sprite is moving diagonally (for example: down and right at the same time), even though I update both its player0x and player0y variables at the same time in the same frame, when debugging in Stella (especially visible when slowing down Stella to 10% speed: press Ctrl+Shit+S), I see that the sprite is first moving down, and only after that movement is complete it then moves right, instead of moving down AND right at the same time. This creates an "stairstep" effect when moving diagonally. Debugging in Stella, I see that my code is correctly updating both coordinates at the same time. Have you seen something similar in your games? How can I avoid this stairstep effect? I want a smooth diagonal movement, and this stairstep creates a "jitter" in the sprite movement. EDIT: Just noticed that in the RT tutorial, it mentions in the VBLANK section: "Note that running code here means that certain changes won't take effect until the next drawscreen. Particularly, changing x-positions of objects or the score will be delayed." which seems to be my problem. Is there anything I can do to avoid/hide this delay? I also had an issue when positioning the ball object in VBLANK. The problem was that even though I was hiding the ball object by moving it to coordinates 255,255, the ball would briefly appear for a single frame in the screen. I solved it by moving the code out of the VBLANK section, but that was a smaller code with little impact on my cycles. Edited May 26, 2022 by rfunes Quote Link to comment Share on other sites More sharing options...
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.