#12689 - ken2 - Sat Nov 22, 2003 7:37 pm
I have a problem involving the sprite flipping upside down when it gets to -1 x on the screen. From what I've heard before, this is a probably a problem with the real coordinates of the sprite, but the funny thing is I'm using a function that looks like it should fix that.. could anyone tell me if anything is wrong with this code? I pass it soanso.x and soandso.y once I have an input check which changes them around.
Code: |
void MoveSprite(OAMEntry* sp, int x, int y)
{ if(x < 0) x = 512 + x; if(y < 0) y = 256 + y; sp->attribute1 = sp->attribute1 & 0xFE00; sp->attribute1 = sp->attribute1 | x; sp->attribute0 = sp->attribute0 & 0xFF00; sp->attribute0 = sp->attribute0 | y; } |