Blau
• Member for 10 years, 5 months
• Last seen more than a month ago
• Spain

21k views

Parabolic trayectory function is defined as: Fx = Vox*t + Ox; Fy = -0.5 * g * t * t + Voy*t + Oy; Known values: P: the target point. O: the origin point. g: gravity. t: time needed to ...

5k views

MeasureString() returns to you a Vector2 where the X is the width and Y is the height of the text. Also the SpriteFont class has a LineSpacing member that gives you the height of a line, including ...

11k views

if Game.IsFixedTimeStep is true the update method will be called every 1/60 seconds http://msdn.microsoft.com/en-us/library/microsoft.xna.framework.game.isfixedtimestep.aspx "The default value for ...

2k views

You are looking for a funnel algorithm. Here you are a simple one http://digestingduck.blogspot.com.es/2010/03/simple-stupid-funnel-algorithm.html Basically, the algorithm identify edges as ...

1k views

You can create a Texture2D this way. Texture2D Mountain = new Texture2D( GraphicsDevice, Width, Height); Color[] PixelData = new Color[Width * Height]; Color colA,colB; ...

3k views

If you work with premultiplied alpha, the default behaviour, you have to multiply the alpha.... public void Update() { color*= 0.95f; position.X += 3; if (color.A &lt;= 10) isDead = ...

425 views

Don't create a random generator in each call to the AddParticle() method. It will return always the same value. Also you may want to pass a different seed to the the generator each time you create ...

2k views

\begin{align} P &amp;= t (B-A) + A \\ P_x &amp;= t (B_x - A_x) + A_x \\ P_y &amp;= t (B_y - A_y) + A_y \\ \end{align} $$\frac {P_x - A_x} {B_x - A_x} = \frac {P_y - A_y} {B_y - A_y}$$  \...

259 views

it can be done modifying the bone transform of your model. You don't need submeshes, each vertex in a model should have a bone weight property that quantify how that vertex is affected by the bone ...

180 views

You should calculate the intersection point (IP) between the two lines. (X - Ax) (Y - Ay) EQ1 = -------- = -------- =&gt; (X-Ax) * (By-Ay) - (Y - Ay) * (Bx - Ax) = 0; (Bx - Ax) ...

569 views

bool[,] Rooms = new Rooms[Width, Height]; bool IsPositionAvalaible(int x, int y) { return !Rooms[x,y];} bool SetPositionValue(int x, int y, bool Avalaible) { Rooms[x,y] = !Avalaible; }

616 views

The X position of the background have to be calculated with the X position of the player and a speed factor. Texture2D ParallaxTex; Rectangle ParallaxBounds = graphics.Viewport.Bounds; ...

339 views

I think are doing over engineering the cubes... it would be easier to use an enum, it is better because let's you indexing cube properties in arrays or sorting the cubes easily, You don't need to ...

19k views

You can use TreeSharp and behaviour trees to model a dialogue system. TreeSharp is a library that provides a simple behaviour tree implementation. IA bots for wow are done with this, so it's mature......

153 views

You may have several problems: A) Using string for directions is not a good idea... because the string comparation is slow and case insensitive... is much better using an enumeration or integers......

1k views

You can launch a external debugger... you only have to add the line System.Diagnostics.Debugger.Launch() and you will can debug it. I think that you maybe need Visual Studio Professional or the .Net ...

5k views

In this sample you can find an algorithm to pack small textures into a big texture, that is quite similar to your matter... and maybe a good start to solve it. http://create.msdn.com/en-US/education/...

2k views

This are the meanings: t = TimeElapsed =&gt; Range[0, Duration] b = InitialValue; c = FinalValue - InitialValue; d = Duration; I have a similar code to this for every easing function: ...

496 views

int TotalWeight = 100; int[] ItemWeights = new int[] {80, 10, 10}; enum Items {Apple, Orange, Banana} Items GetRandomItem() { int random = Random.Next(TotalWeight); int i=0; while (...

10k views

You need a list of points and a list of balloons class Path { List&lt;Vector2&gt; Points; float[] Lengths; Vector2[] Directions; void Build() { Lengths = new float[Points....

23k views

I think this will be enough if you don't use scale. float Angle = RotationTankA - RelativeAngle; PosTankB = PosTankA + new Vector2(cos(Angle), sin(Angle)) * Distance;

1k views

You are drawing all sprites in the same postition and same size, if textures don't have alpha channel you will only see one of them. Test this to draw a grid with 8 columns: var size = 100; ...

253 views

Seems to me that you are not applying the bone transforms. If you are going to evaluate collisions this way, it would be much better to calculate the absolute bounding spheres in world coordinates. ...

176 views

I have drawed this to explain the behaviour when a collision with AABB boxes is present. When you have choosen what dimension has to be fixed, you can change the position of the object that was ...

617 views

"dot" is a cosin not an angle, can not be compared to "fovRad" that is an angle You can get angle of "dot" with an arccosine function, or get the cosine of "fovRad" to compare them.

2k views

You can use XnaTweener that provides easing functions that interpolate values from one point to another in a easy way... Here is a reply with some code based in the Xna Tweener project and a video ...

476 views

you call to base.LoadContent() inside LoadContent and the method is not overrided. Maybe adding the override tag and removing the content manager parameter will do the trick ... public override ...

482 views

Use SamplerState.PointClamp to avoid the GPU interpolating texture coordinates with the nearest points.

3k views