I. Three animations in Silverlight:
The creation of storyboard animations must depend on the associated attributes (dependency attributes) to provide a solution for creating a series of highly continuously changing animations, and even implement more complex keyframe animations.
Compositiontarget animation is suitable for changing the time attribute when the global screen is refreshed, such as game loop.
Dispatchertimer animation is very suitable for the use of the object's own motion animation, such as the movement of the genie, combat, cast action, magic play animation, and so on.
Ii. "Eight orientations" Algorithm
/// <Summary>
/// Calculate the tangent between the current coordinate and the target point to obtain the orientation
/// </Summary>
/// <Param name = "current"> current coordinate </param>
/// <Param name = "target"> Target coordinate </param>
/// <Returns> orientation code 0, 1, 2, 3, 4, 5, 6, and 7 </returns>
Public int getdirection (Point Current, Point Target ){
Double tan = (target. Y-current. Y)/(target. X-current. X );
If (math. Abs (TAN)> = math. Tan (math. Pi * 3/8) & target. Y <= current. Y ){
Return 0;
} Else if (math. ABS (TAN)> math. tan (math. PI/8) & math. ABS (TAN) <math. tan (math. pI * 3/8) & target. x> current. X & target. Y <Current. Y ){
Return 1;
} Else if (math. Abs (TAN) <= math. Tan (math. PI/8) & target. x> = current. X ){
Return 2;
} Else if (math. ABS (TAN)> math. tan (math. PI/8) & math. ABS (TAN) <math. tan (math. pI * 3/8) & target. x> current. X & target. y> current. Y ){
Return 3;
} Else if (math. Abs (TAN)> = math. Tan (math. Pi * 3/8) & target. Y> = current. Y ){
Return 4;
} Else if (math. ABS (TAN)> math. tan (math. PI/8) & math. ABS (TAN) <math. tan (math. pI * 3/8) & target. x <Current. X & target. y> current. Y ){
Return 5;
} Else if (math. Abs (TAN) <= math. Tan (math. PI/8) & target. x <= current. X ){
Return 6;
} Else if (math. ABS (TAN)> math. tan (math. PI/8) & math. ABS (TAN) <math. tan (math. pI * 3/8) & target. x <Current. X & target. Y <Current. Y ){
Return 7;
} Else {
Return 0;
}
}
Iii. Understanding of Velocity Coefficient
Understanding of the speed coefficient.
Mathematical formula: S = V * t
Here (k is the speed coefficient): S * k = T. In this case, S/T = 1/K. That is, V = 1/K. The time when the distance is multiplied by the coefficient.
In this way, the larger the speed coefficient, the smaller the moving distance per unit time (speed), and the slower the object motion.
Let's look at this formula: S * k = T. Is the greater the coefficient "K", the larger the time "T" is used. "S" is a long time away, and the speed is naturally slow.
Friend, if you have any insights, you can add "Sina Weibo"/MSN Oh, starrycheng@live.com, we all discuss together, study together.
Finally, let's add one point for the whole space system.