JohnEarnest / chip8Archive

A repository of community-submitted Chip8 programs and their metadata
147 stars 23 forks source link

Question - Player sprite vanishing when past top border #29

Open coornio opened 1 year ago

coornio commented 1 year ago

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?