Ejemplo n.º 1
0
 public void CatWanderRoundStart()
 {
     CatCurrentActionStop();
     CatSprite.WalkStart();
     ResetWanderDestination();
     CatWanderTimer.Start();
 }
Ejemplo n.º 2
0
        public void CatTakeMouseStart()
        {
            StopAllTimer();
            CatSprite.StopAll();

            MouseTaken = true;
            CatSprite.WalkStart();
            ResetWanderDestination();
            CatTakeMouseTimer.Start();
            MoveMouseTimer.Start();
        }
Ejemplo n.º 3
0
 private void TurnLeftOrRight(double nowX)
 {
     if (0 > nowX)
     {
         CatSprite.WalkLeft();
         CatSprite.StationaryLeft();
         CatSprite.RunLeft();
         CatFaceLeft = true;
     }
     else if (0 < nowX)
     {
         CatSprite.WalkRight();
         CatSprite.StationaryRight();
         CatSprite.RunRight();
         CatFaceLeft = false;
     }
 }
Ejemplo n.º 4
0
        private void TakeMouse(double catSpeed)
        {
            Point  position  = WanderDestination;
            double CatLeft   = Canvas.GetLeft(Cat);
            double CatTop    = Canvas.GetTop(Cat);
            double threshold = Cat.Width / 2;

            var    direction = GetDirection(position, CatLeft, CatTop);
            double distance  = GetDistance(direction);

            if (distance > threshold)
            {
                MoveCatSprite(direction, distance, CatLeft, CatTop, catSpeed, position);
            }
            else
            {
                MouseTaken = false;
                CatSprite.WalkStop();
                CatSprite.StationaryStart();
                MoveMouseTimer.Stop();
            }
        }
Ejemplo n.º 5
0
 public void CatCurrentActionStop()
 {
     CatSprite.StopAll();
     StopAllTimer();
     MouseTaken = false;
 }
Ejemplo n.º 6
0
 public void CatChaseMouseStart()
 {
     CatCurrentActionStop();
     CatSprite.RunStart();
     CatChaseMouseTimer.Start();
 }