gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

C/C++ > Sprite Position

#108855 - QuantumDoja - Sun Nov 12, 2006 12:15 pm

Hi, I am trying to position an array at x:0, Y: 248, but when i draw the sprite to the screen, it appears at the top of the screen, like its wrapped around....

the top of the screen is 0, then if you move high that this it goes to to like 248(ish)

....maybe i should only draw the sprite as it appears onto the screen

any ideas?
_________________
Chris Davis

#108868 - Edelnutte - Sun Nov 12, 2006 2:39 pm

Could you post some code how you do that exactly?

#108885 - Cearn - Sun Nov 12, 2006 5:29 pm

The coordinate fields in the object attributes form signed integers, so yeah they wrap around. For the y-coordinate you essentially have a char. 248 = 0xF8 -> -8 when sign-extended.