Tag Info

Hot answers tagged

3

You could reduce the damage for each piece individually. That way you never reach 0 unless a piece reduces it by 100%. You can get very low though. You could also make the different pieces never total 100%. Helmet max 15% torso max 20% arms max 10% legs max 10% Max damage resistance would be 55% like that. You could also go with a much more refined ...


2

Sorry everything would look nicer if latex formatting would be possible. Let's consider three gears: G1, G2 and G3. Now each gear has a given radius r1, r2 and r3. The problem is to find the angular velocity for each gear (denoted av1, av2 and av3). From a physics course we know that the tangent velocity v is proportional to the radius: v1 = av1 * r1. ...


2

I'm not sure if I understand your question but here goes: I think you want the sprite to wave over an angle back and forth: Not this is pseudocode (as you didn't state the language): t=(t+wavespeed)%TwoPi; a = Sin(t)*amplitude; Position.X=StartPosition.X + Cos(angle) * a; Position.Y=StartPosition.Y + Sin(angle) * a; t controls the waving motion; the ...


2

Solution for 2D vectors: Vector2 AB = B - A; // Vector from A to B Vector2 A0 = r * AB.normalized; // Vector from A to 0° Vector2 A90 = new Vector2(A0.y, -A0.x); // Vector from A to 90° Vector2 P = A + Sin(alpha) * A90 + Cos(alpha) * A0; // Coordinate of arbitrary point on a circle For arbitrary 3D vectors A and B in 3D space you need coordinates of ...


1

Since you are working in 3d world space, why not use the BoundingFrustum class? BoundingFrustum cameraBounds = new BoundingFrustum(view * projection); if(cameraBounds.contains(location)) { // it is in view } else { // not in view } edit. I assumed you are using XNA. If not, you can still reflect the XNA code to see how to make a Bounding frustum ...


1

The Wikipedia article on collision detection has this to say on the topic of matrices and collision detection; So we reduce the problem to that of tracking, from frame to frame, which intervals do intersect. We have three lists of intervals (one for each axis) and all lists are the same length (since each list has length n, the number of bounding boxes.) ...


1

Technically, a line has no beginning or end. It is infinite in length. For disambiguation, this is often called a ray in graphics programming. A line of this type is described by any point on the line plus a direction. A line segment is what most people are referring to when they say 'a line'. It has a beginning and an end point. It's common to refer to a ...


1

It's hard to tell what exactly you are looking for but line segments are commonly described by their endpoints, or by a point, a normalized direction vector and a length. Another way would be a starting point and a non normalized direction vector which also is the length. For the purposes of raytracing, I usually use that second form (starting point, ...


1

First you need to find the slope of the line from A to B, then find the perpendicular slope. Lastly, find where the lines intersect. The trick is that this is not actually a real triangle problem. Instead, you are trying to find the point on a line that is closest to another point (point C). The point on the line that is closest to the point will /always/ ...


1

Don't have the damage reduction be additive, have it multiplicative. Damage = Damage * (1.0 - helmetReduction) * (1.0 - gloveReduction) * (1.0 - trousersReduction) * (1.0 - upperArmorReduction) Each layer of armor reduces not the complete damage, but the damage remaining from the previous layer. As long as no single ...


1

Think ease of use. You always have to start with what you want to achieve first. And it can all be made simple - I want the weakest unit to kill the weakest player with 20 hits. I want the strongest unit to kill the strongest player with 10 hits. The rest is just curving the increments between them. You can build any game on these two considerations ...


1

Your point selection rules can be satisfied by a Poisson-Disk sampling distribution & can be solved in O(n) with Bridson's algorithm. Basically, the algorithm divides the output region into a grid of cells sized relative to the minimum allowable distance, such that only one point can appear in each cell. Then, when you consider adding a new point, you ...


1

You'll need to create some way to control the damage passing through. For example: light armor has a maximum reduction of 75%, medium 85% and heavy 95%. If the total reduction combined is above the number, use that value instead. You could also create a weighed reduction: say the player wears one heavy, two medium and one light piece of armor: ...



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