AndEngine Sprite position

Posted by Kirill Kulakov on Game Development See other posts from Game Development or by Kirill Kulakov
Published on 2012-11-10T14:41:48Z Indexed on 2012/11/10 23:19 UTC
Read the original article Hit count: 296

Filed under:
|

I had noticed the AndEngine a few days ago, and I tried to create basic game with a few Sprites.Sure, the engine makes the development process much more easier.However I found the sprite lacking a major functionally:

Whenever there is a need to refer to the position of an Sprite the engine manipulates the position based on the top-left corner of sprite,this is not the best thing because there is a need to subtract/add the width/height to its position in order to refer to its center.However when we refer to he scale of the Sprite it scaled according to its center point (which is great)

I find it very confusing to refer to its position each time differently.I solved that by extending the Sprite class and implementing my methods of setCenter and getCenter, I guess that not the best way to do so.

Do you have any suggestion?

© Game Development or respective owner

Related posts about android

Related posts about andengine