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.

Beginners > Sprite Bounding Box

#50917 - QuantumDoja - Sun Aug 14, 2005 3:17 pm

Hi, I have a sprite in a bounding box like so...

Code:

______________
|        _   |
|       | |  |
|       |_|  |
|            |
|____________|


Assume that the bouding box is 64px by 64px, the top left of the bounding box is the position of the sprite.

There are approximately 40px of 'space' between the edge of the bounding box and the acctual sprite itself....so here is my problem.

I can move the sprite around the screen, limiting the movement so that the bounding box cannot exceed the size of the screen

If however I move the sprite so that I am using the acctual sprite dimensions (so the sprite goes tightly to the left hand corner of the screen when its moved) the sprite flips upsidedown.....

How can i make it so that I can move the sprite to the far edge without the sprite flipping?
_________________
Chris Davis

#50923 - tepples - Sun Aug 14, 2005 4:35 pm

When the upper left corner of the sprite's bounding box goes off the left or top of the screen, the display messes up, right? You're experiencing the same problem discussed in topic 6375.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#50925 - QuantumDoja - Sun Aug 14, 2005 6:11 pm

Tepples, you are a god among men!!

I should have searched these forums for that.

Thank you!!
_________________
Chris Davis