Пример #1
0
        void HandleTouchesMoved(System.Collections.Generic.List <CCTouch> touches, CCEvent touchEvent)
        {
            //Unfortunatelly framework isn't ready to reflect movement correctly in case we reassing Action each tick
            if (ticks % 2 == 0)
            {
                return;
            }

            // we only care about the first touch:
            var locationOnScreen = touches [0].Location;

            CCPoint point = new CCPoint();

            point.X = locationOnScreen.X;
            point.Y = Math.Min(locationOnScreen.Y, playerMarking.BoundingBoxTransformedToParent.MaxY);
            float    duration = playerPlatform.TimeToGet(point);
            CCMoveTo action   = new CCMoveTo(duration, point);

            playerPlatform.StopAllActions();
            playerPlatform.AddAction(action);
        }