Beispiel #1
0
        protected override void DoPointDisplacement(AnimatedPoint point, int currentFrame)
        {
            var direction = (int)Geometry.GetPolarCoordinates(TouchLocation, point.Point);

            var distCanMove = 20;

            point.XDisplacement = Random.Rand.Next(-_displacementRange, _displacementRange);
            point.YDisplacement = Random.Rand.Next(-_displacementRange, _displacementRange);

            //limiting the total dist this point can travel
            var maxXComponent = Geometry.getXComponent(direction, distCanMove);
            var maxYComponent = Geometry.getYComponent(direction, distCanMove);

            point.SetMaxDisplacement(maxXComponent, maxYComponent);
        }
Beispiel #2
0
        protected override void DoPointDisplacement(AnimatedPoint point, int currentFrame)
        {
            var direction = (int)Geometry.GetPolarCoordinates(TouchLocation, point.Point);

            var distCanMove      = shortestDistanceFromPoints(point.Point);
            var frameDistCanMove = frameLocation(currentFrame, NumFrames, distCanMove);

            point.XDisplacement = Geometry.getXComponent(direction, frameDistCanMove);
            point.YDisplacement = Geometry.getYComponent(direction, frameDistCanMove);

            //limiting the total dist this point can travel
            //(its possible for stacked animations to animate the same point, want to limit the total distance the point can travel)
            var maxXComponent = Geometry.getXComponent(direction, distCanMove);
            var maxYComponent = Geometry.getYComponent(direction, distCanMove);

            point.SetMaxDisplacement(maxXComponent, maxYComponent);
        }