Duane Hoyt

Welcome to my page! Hope that you find my tutorials useful and be sure to come back for more on updates.

12/4/2011

Today I released the Jump Sprite XNA video tutorial. You can download the source code here. In this video provides an explanation on creating a very basic stick figure animation that can be imported into an XNA project.

In the Player.cs file contains the StartJumping() method that performs calculations on the position of the character before rendering.

double nextPosition = Math.Sin(MathHelper.ToRadians(Degrees));

Under the XNA Framework contains the ToRadians method of the MathHelper class that can be converted from degrees to radians. This will allow the sine function to be calculated for the new jump distance.

JumpDistance += nextPosition * (_reverseInDirection ? velocity : -velocity);

The velocity variable is also used to determine the speed and it's direction while jumping.

Feel free to make changes in the sample source code and explore.

Enjoy