Friday, July 10, 2009

Fly Up AND Left

var forcex=Math.round(body.GetPosition().x-bodya.GetPosition().x);
var forcey=Math.round(body.GetPosition().y-bodya.GetPosition().y);

var nullX=Math.sqrt((forcex)*(forcex) + (forcey)*(forcey))

//if (Math.abs(forcey)==0)///fly horizontal
if (Math.abs(forcex)==0)///fly up
//if(body.GetPosition().x>5 && body.GetPosition().x<7 && body.GetPosition().y<9)

{
trace("rt")
body.ApplyForce( new b2Vec2(-3, 0), body.GetWorldCenter());
}

No comments:

FEEDJIT Live