예제 #1
0
        //点击按钮,摆球
        private void Desk_MouseDown(object sender, MouseButtonEventArgs e)
        {
            Desk.Focus();

            if (gameControl.status == Status.SetBallandWaitHit && !gameControl.isXuLi)
            {
                if (gameControl.setLock)
                {
                    gameControl.setLock = false;
                    //球杆隐藏
                    gameControl.currPlayer.club.IsHide = true;
                }
                else
                {
                    gameControl.setLock = true;
                    //球杆显现
                    gameControl.currPlayer.club.IsHide   = false;
                    gameControl.currPlayer.club.HitPoint = gameControl.Balls[0].Position;
                }
                System.Console.Out.WriteLine("锁定:" + gameControl.setLock);
            }

            /*
             * System.Console.Out.WriteLine("点击鼠标");
             * Point point = e.GetPosition((Canvas)sender);
             * System.Console.Out.WriteLine("点击坐标 X: " + point.X + " Y: " + point.Y);
             */
        }