Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualtom_mai78101

Posted 29 December 2012 - 01:41 AM

This! Yes! This works. Now, I can continue to flesh out some more incline (pipe) collisions. Thanks! biggrin.png

Code for those curious:

 

float dax = (p.dstRect.left + p.dstRect.width() / 2) - position[0];
float day = (p.dstRect.top + p.dstRect.height() / 2) - position[1];
float dan = FloatMath.sqrt(dax * dax + day * day);
dax /= dan;
this.acceleration[0] -= dax;

#2tom_mai78101

Posted 04 October 2012 - 04:30 AM

This! Yes! This works. Now, I can continue to flesh out some more incline (pipe) collisions. Thanks! Posted Image

Code for those curious:

[source lang="java"] float dax = (p.dstRect.left + p.dstRect.width() / 2) - position[0]; float day = (p.dstRect.top + p.dstRect.height() / 2) - position[1]; float dan = FloatMath.sqrt(dax * dax + day * day); dax /= dan; this.acceleration[0] -= dax;[/source]

#1tom_mai78101

Posted 04 October 2012 - 04:29 AM

This! Yes! This works. Now, I can continue to flesh out some more incline (pipe) collisions. Thanks! :D

PARTNERS