Jump to content

Real body x position (P2)


Recommended Posts

I want on collision calculate positions of player and items that collides and evaluate if items is in certain bounds in relation to player.


But I'm not sure what is real position of body, not sprite image.


I was going through documentation and objects and found these coordinates:


but the values doesn't make sense to me:


player has dimensions 296x135px

and body starts ~18px from sprite left side and ends ~40px from right side.

anchor is set to 0,0


x looks like center of body (sprite was moved almost to border) 

296-58 = 238/2 = 119 + 18 = 137


also in 2.4 _bounds are not calculated and I'm getting 0 all the time.


how can I calculate x position on start of body and end of body, to be able detect if collision like on the picture?


//EDIT: also items are rotating and colliding, so I need real x body position.


Link to comment
Share on other sites


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...