The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.
It's late and my brain isn't working and I can't figure out how to deal with this. I have two numbers, and I want to reduce them by a number such that their sum is a fixed number. Here's a set of equations I think might be helpful, but I'm not sure how to solve for n:
Xa/n = Xb
ya/n = Yb
Xb + Yb = 8
The only numbers I have to start with are Xa and Xb.
Ha, I'm even more retarded than I initially thought. Despite the fact that I dealt with this same problem about a million times when I was working on Metroid Lightspeed, I totally forgot how to fire an angled projectile at a consistent speed.
Posts
Running with being given Xa and Ya, and wanting to figure out n, then:
n = (Xa + Ya) / 8
?
Oh, right, I misunderstood the question. Never mind me. I just checked, and you're correct.
float firingAngle = Statics.getAngleRadians(position, target.Position);
Vector2 shotDir = new Vector2(8 * (float)Math.Cos(firingAngle), 8 * (float)Math.Sin(firingAngle));