rgk Posted May 26, 2015 Share Posted May 26, 2015 So I'm trying to change the angle of a sprite based on bitmap collision detection:var angle = Phaser.Math.angleBetween(Math.floor(mech.body.center.x), Math.floor(mech.body.bottom), Math.floor(mech.body.prev.x + (mech.body.width / 2)), Math.floor(mech.body.prev.y + mech.body.height));Problem it produces a 90 degree angle by default and is very random, any ideas what I may be doing wrong here?Edit: forgot bottom is a y variable, but still gives me a weird angle. Link to comment Share on other sites More sharing options...
Recommended Posts