Jump to content

Bug in Arcade Body After Rotation since 2.4.8?


jtbdevelopment
 Share

Recommended Posts

I have a simple battleship style game previously working on 2.4.3.  As part of setting up the ships you can rotate them by double clicking.  For overlap and edge detection, during this phase I enable arcade physics.  Pretty simple stuff game wise.  

Recently tried upgrading to 2.5.0 and discovered some odd behaviour in setup screen that I traced back to body position after rotation and eventually traced back to 2.4.8 though trial and error.  The sprite starts horizontal (and how the underlying image was drawn) and the body is good.  Rotating the sprite (and resizing the body to flip width/height) to vertical causes the body to be offset from the image.  Rotating back fixes it.  The amount offset depends on size of image, but the longer images get further offset both x and y (even though images only have differences in size in one dimension).  I note I am using a non-0 anchor (because I want the ship to rotate around it's center when I do rotate it)

I tried undoing the most obvious set of changes in Arcade.Body preupdate as part of that release but that doesn't appear to be it.

Here's a set of screenshots after rotating one ship.  The body debug has been enabled and you can see the difference in 2.4.7 vs 2.4.8.

 

The code is at https://github.com/jtbdevelopment/TwistedBattleship/blob/master/ui/app/scripts/services/shipGridV2.js - the relevant rotation is at line 304, you may also want to look at line 170 in placeShip function which is where sprites are initialized.

Any help appreciated.

(please no poking fun of my art asset - an artiste I am not :))

2.4.7body.png

2.4.8body.png

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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