Exemplo n.º 1
0
        // Construct new GameSettings instance using default values
        public GameSettings(LoderGame game)
        {
            // Find suitable screen size
            int screenWidth = 1024;
            int screenHeight = 768;
            int maxScreenWidth = game.GraphicsDevice.DisplayMode.Width - 100;
            int maxScreenHeight = game.GraphicsDevice.DisplayMode.Height - 100;
            /*
            DisplayDevice currentDisplayDevice = DisplayDevice.GetDisplay(DisplayIndex.Primary);
            List<DisplayResolution> availableResolutions = currentDisplayDevice.AvailableResolutions as List<DisplayResolution>;

            foreach (DisplayResolution displayResolution in availableResolutions)
            {
                if (displayResolution.Width < maxScreenWidth && displayResolution.Height < maxScreenHeight &&
                    displayResolution.Width >= screenWidth && displayResolution.Height >= screenHeight)
                {
                    screenWidth = displayResolution.Width;
                    screenHeight = displayResolution.Height;
                }
            }
            */
            _screenWidth = screenWidth;
            _screenHeight = screenHeight;
            _fullscreen = false;
            _controllerType = GamePad.GetState(PlayerIndex.One).IsConnected ? ControllerType.Gamepad : ControllerType.KeyboardAndMouse;
        }
Exemplo n.º 2
0
        // Construct new GameSettings instance using default values
        public GameSettings(LoderGame game)
        {
            // Find suitable screen size
            int screenWidth     = 1024;
            int screenHeight    = 768;
            int maxScreenWidth  = game.GraphicsDevice.DisplayMode.Width - 100;
            int maxScreenHeight = game.GraphicsDevice.DisplayMode.Height - 100;

            /*
             * DisplayDevice currentDisplayDevice = DisplayDevice.GetDisplay(DisplayIndex.Primary);
             * List<DisplayResolution> availableResolutions = currentDisplayDevice.AvailableResolutions as List<DisplayResolution>;
             *
             * foreach (DisplayResolution displayResolution in availableResolutions)
             * {
             *  if (displayResolution.Width < maxScreenWidth && displayResolution.Height < maxScreenHeight &&
             *      displayResolution.Width >= screenWidth && displayResolution.Height >= screenHeight)
             *  {
             *      screenWidth = displayResolution.Width;
             *      screenHeight = displayResolution.Height;
             *  }
             * }
             */
            _screenWidth    = screenWidth;
            _screenHeight   = screenHeight;
            _fullscreen     = false;
            _controllerType = GamePad.GetState(PlayerIndex.One).IsConnected ? ControllerType.Gamepad : ControllerType.KeyboardAndMouse;
        }
Exemplo n.º 3
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            // Get version
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
            version = string.Format("Version {0}.{1}", fvi.FileMajorPart, fvi.FileMinorPart);

            // Create logger
            StasisCore.Logger.initialize();
            StasisCore.Logger.log(string.Format("Loder's Fall ({0}) started.", version));

            // Run game
            using (LoderGame game = new LoderGame(args))
            {
                game.Run();
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        static void Main(string[] args)
        {
            // Get version
            FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);

            version = string.Format("Version {0}.{1}", fvi.FileMajorPart, fvi.FileMinorPart);

            // Create logger
            StasisCore.Logger.initialize();
            StasisCore.Logger.log(string.Format("Loder's Fall ({0}) started.", version));

            // Run game
            using (LoderGame game = new LoderGame(args))
            {
                game.Run();
            }
        }