コード例 #1
0
        protected override void OnMouseDown(MouseButtonEventArgs e)
        {
            base.OnMouseDown(e);
            if (Mouse.X > 199 && Mouse.X < 400)
            {
                if (Mouse.Y > 99 && Mouse.Y < 150)
                {
                    //Resume Game Clicked
                    currentGame.MakeCurrent();
                    this.Close();
                }
                else if (Mouse.Y > 199 && Mouse.Y < 250)
                {
                    //Main Menu Clicked
                    this.Close();

                    currentGame.networkManager.setActive(false);
                    currentGame.networkManager.closeSocket();

                    currentGame.Close();
                    using (MainMenu main = new MainMenu())
                    {
                        main.Run();
                    }
                }
                else if (Mouse.Y > 299 && Mouse.Y < 350)
                {
                    this.Close();
                    currentGame.Close();
                    Environment.Exit(0);
                }
            }
        }
コード例 #2
0
        //Main method
        static void Main(string[] args)
        {
            using (MainMenu main = new MainMenu())
                main.Run(120, 60);

            /*using(Game game = new Game(15, 15, 1))//third int = 0 for normal or 1 for hard
             * {
             *  //Run the game
             *  game.Run(120, 60);
             * }*/
        }