chip8Archive icon indicating copy to clipboard operation
chip8Archive copied to clipboard

Question - Player sprite vanishing when past top border

Open coornio opened this issue 1 year ago • 0 comments

As the title implies, NeatBoy disappears when he jumps up and his top exceeds row 0 to go "negative".

https://user-images.githubusercontent.com/11655762/235313249-62e2b6e2-86aa-4b93-b5ae-b54bf236ad75.mp4

From my understanding, this behavior is actually controlled via the rom itself, as enabling wrapping allows him to naturally wrap around vertically when falling down, but the same does not occur when moving up.

I understand the reasoning behind it -- you don't want the character's head to be popping up from the bottom of the screen when this occurs, so you're hiding the entire sprite in such a situation. Perhaps, however, it might be possible for you to instead check how many rows behind row 0 the sprite is, and only allow drawing the character from that row down, so that he'd naturally be clipped without disappearing briefly when skirting the edge?

coornio avatar Apr 29 '23 16:04 coornio