public void CatWanderRoundStart() { CatCurrentActionStop(); CatSprite.WalkStart(); ResetWanderDestination(); CatWanderTimer.Start(); }
public void CatTakeMouseStart() { StopAllTimer(); CatSprite.StopAll(); MouseTaken = true; CatSprite.WalkStart(); ResetWanderDestination(); CatTakeMouseTimer.Start(); MoveMouseTimer.Start(); }
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; } }
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(); } }
public void CatCurrentActionStop() { CatSprite.StopAll(); StopAllTimer(); MouseTaken = false; }
public void CatChaseMouseStart() { CatCurrentActionStop(); CatSprite.RunStart(); CatChaseMouseTimer.Start(); }