Jump to content

game.world.bounds.intersects(body) does not work for left bounds (x<0)


valueerror
 Share

Recommended Posts

i am using this function to check if  a body that jumped over a ramp (and therefore was set to sensor=true) has left the worldbounds and should be killed.

this works for all edges of the world except for the left one..

 

i can manage to make it work by asking for 

if (body.x <0) {killit }

but if i use the intersects method it will always return true even if  x is much smaller than 0  

 

if i console.log the game.world.bounds i get:

b.Rectangle {x: 0, y: 0, width: 3200, height: 2560, offset: function…} 

so with the worldbounds it seems everything is ok.

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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