🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

cannot clip the NPC

Started by
0 comments, last by VanVan 22 years, 11 months ago
Sorry, can anyone tell me that i can only clip the bottom side of tile while i move the tile down, but i cannot clip the top side of tile while i move the tile up thanks regard!!! //*** D key if (GetAsyncKeyState(0x44)) { SPosY += 1; } //*** E key if (GetAsyncKeyState(0x45)) { SPosY -= 1; } RECT rcSrc {0, 0, 32, 32}; //If this tile is off the top of the screen... if (SPosY < 0) { rcSrc.top -= SPosY; } //If this tile is off the bottom of the screen... if ((SPRITE_DIAMETER + SPosY ) > SCREEN_HEIGHT) rcSrc.bottom -= SPosY + SPRITE_DIAMETER - SCREEN_HEIGHT; g_pDisplay->Blt( SPosX,SPosY, g_pAnimationSurface, &rcSrc);
Advertisement
Just a guess, shouldn''t "rcSrc.top -=" actually be "rcSrc.top +="?

This topic is closed to new replies.

Advertisement