Jump to content

How to change the sprite bounds angle?


ogramp
 Share

Recommended Posts

Top-down lawnmower driving around in a yard with flowers. 

I'm checking collisions between flowers and the lawnmower. Problem is when I'm driving the lawnmower at a 45 degree angle past a flower (sprites do not overlap) the game cuts the flower down. I t tried troubleshooting and the debug.body(flower) and game.debug.body(lawnmower) show my their Bounds boxes (they overlap) and from there comes my question.

Why doesn't the bounding box rotate when I change the sprite angle? I've tried looking for ways to change the angle but game.debug.body(lawnmower).angle does nothing.

 

EDIT: I think I found the answer myself. From Phaser.io API docsumentation: ... the collision Body itself never rotates, it is always axis-aligned ... 

 

Edited by ogramp
Found the answer.
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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