示例#1
0
        static void Main()
        {
            System.Environment.CurrentDirectory = Path.GetDirectoryName(Application.ExecutablePath);
            var errorHandler = new ErrorHandlerPPD();

            errorHandler.Initialize();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Game game = null;

            try
            {
                PPDSetting.Initialize();
                game = new MyGame(new PPDExecuteArg(new string[] { }));
                game.Run();
            }
            catch (Exception e)
            {
                SplashForm.CloseSplash();
                errorHandler.ProcessError(e);
                if (game != null)
                {
                    try
                    {
                        game.Window.RescueData();
                    }
                    catch
                    {
                    }
                    game.Window.Close();
                }
            }
            finally
            {
                if (game != null)
                {
                    game.Dispose();
                    game = null;
                }
            }
        }
示例#2
0
 public MainGame(PPDDevice device, MyGame mygame, PPDFramework.Resource.ResourceManager resourceManager, SquareGrid squareGrid) : base(device)
 {
     this.resourceManager = resourceManager;
     AddChild(mpd         = new MarkPointDrawer(device, resourceManager));
     AddChild(kasi        = new TextureString(device, "", 20, true, PPDColors.White)
     {
         Position = new Vector2(400, 415)
     });
     AddChild(mgt         = new MainGameTop(device, resourceManager));
     AddChild(mgb         = new MainGameBottom(device, resourceManager));
     AddChild(up          = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "up.png")));
     AddChild(upSelect    = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "upselect.png")));
     AddChild(right       = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "right.png")));
     AddChild(rightSelect = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "rightselect.png")));
     AddChild(area        = new PictureObject(device, resourceManager, Utility.Path.Combine("assist", "area.png")));
     AddChild(angleLine   = new LineComponent(device, resourceManager, PPDColors.Blue)
     {
         LineWidth = 3
     });
     AddChild(dummy = new DummyDrawComponent(device));
     AddChild(grid  = new GridComponent(device, resourceManager, squareGrid));
 }