Pages

Wednesday, December 7, 2011

On Positioning

While coding the element that would allow the player to select a target I ran into the problem of assuming the reference point of my sprites (2D pictures) was in the upper left hand corner, as was the default. For the animation of my sprites, i use code written by Microsoft in their Platformer XNA Demo. The reference is changed to the middle of the bottom of the sprite (for collision detection reasons). After a good fifteen minutes of staring at the normal rectangle bounding intersection statement, i came to realize this and corrected the problem. Only now it works, but only if the mouse if anywhere off to the upper left, yet not inside the actual sprite. Just one of the many bugs a programmer may run into.

TNariksan.

PS. I will attempt to answer any bug questions posted if you may be having similar problems. Also, i apologize for not posting more. More on my latest game system to be implemented. I'm working on a system that would allow the players to learn words (in some lore related language) that would be able to be combined with any other words to create effects, being a totally dynamic system, it has to be nearly bug free.

No comments:

Post a Comment