Hot answers tagged


The edit is reassuring. :) Okay, here's a straightforward update loop... Assuming when we fire the missile we initialize remainingFlightTime = 5f then... void UpdateMissile(float deltaTime) { remainingFlightTime -= deltaTime; // At the end of the trajectory, snap to target & explode. // The math will put us there anyway, but this saves // ...


While Jibb Smart already gave a good answer within the constraints of the question, I would like to step a bit outside the box and question: "Do you actually need perfect balance"? A perfectly imbalanced system can work too and often makes for far more interesting games. For example, you can have one weapon combination which is slightly better than 43 ...


The simplest way to do it would be to lay out your weapon combinations in whatever order you see fit in a circular list. Each combination could have a bonus against the 22 combinations after it in the list, and a weakness against the 22 before it. The player might appreciate a more straight-forward or easier-to-recognise logic to that order -- some sort of ...


You don't need matrices at all. Just take the rotation angle in radians, get its cosine and sine, multiply them by the distance you want between the two objects and add the x and y values of the fixed object: rotatingObject.x = Math.cos(rotationAngle) * distance + fixedObject.x rotatingObject.y = Math.sin(rotationAngle) * distance + fixedObject.y


The clearest way to make sense of any equation is to figure out the units. In this case, it's a bit ambiguous, but you know that velocity is m/h and that radius would be some kind of distance. v^2 is a good assumption in this case, but it is not immediately obvious why without knowing something about the units of the denominator. Just by looking at this, ...


You could rebuild the spears orientation matrix from a direction vector. Good example with dx code is here..

Only top voted, non community-wiki answers of a minimum length are eligible