Inheritance: Microsoft.Xna.Framework.GameComponent
示例#1
0
        public BaseGameState(Game game, GameStateManager manager)
            : base(game, manager)
        {
            GameRef = (DnK)game;

            playerIndexInControl = PlayerIndex.One;
        }
示例#2
0
        public GameState(Game game, GameStateManager manager)
            : base(game)
        {
            StateManager = manager;

            childComponents = new List<GameComponent>();
            tag = this;
        }
 public PatternTestScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
     _bulletInitialPosition = new Vector2(Config.GameArea.X / 2f, Config.GameArea.Y / 3f);
     _patternDirectory = @"Content\Data\Patterns\";
     _patternFileName = "test.xml";
     _patternFile = new FileInfo(_patternDirectory + _patternFileName);
 }
 public LeaderboardScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
     _title = "Leaderboard";
     _messages = new string[]
         {
             "This functionnality is not implemented yet !",
             "[Press Escape to go back to the title screen]"
         };
 }
        public BaseGameState(Game game, GameStateManager manager)
            : base(game, manager)
        {
            GameRef = (DnK)game;

            playerIndexInControl = PlayerIndex.One;

            var controlFont = GameRef.Content.Load<SpriteFont>("Graphics/Fonts/ControlFont");
            ControlManager = new ControlManager(controlFont);
        }
示例#6
0
        public DebugScreen(Game game, GameStateManager manager)
            : base(game, manager)
        {
            Players = new List<Player>();

            // Bloom
            _bloom = new BloomComponent(GameRef);
            Components.Add(_bloom);
            _bloom.Settings = new BloomSettings(null, 0.25f, 4, 2, 1, 1.5f, 1);
            _useBloom = true;
        }
        public GameplayScreen(Game game, GameStateManager manager)
            : base(game, manager)
        {
            Players = new List<Player>();

            // Timer
            _timer = new Timer(Game);

            // Bloom effect
            _bloom = new BloomComponent(this.Game);

            Components.Add(_bloom);
        }
示例#8
0
        public TitleScreen(Game game, GameStateManager manager)
            : base(game, manager)
        {
            _menuText = new string[] { "1 Player", "2 Players", "Shop", "Options", "Exit" };
            _menuDescription = new string[] {
                "Playing game with only one player",
                "Playing game with your best friend",
                "Get new abilities to crush more enemies",
                "You can change inputs here",
                "Warning: I've never tested this button !",
            };

            _menuIndex = 0;
        }
示例#9
0
        public DnK()
        {
            Graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth = Config.Resolution.X,
                PreferredBackBufferHeight = Config.Resolution.Y
            };

            ScreenRectangle = new Rectangle(0, 0, Config.Resolution.X, Config.Resolution.Y);

            IsMouseVisible = true;

            Graphics.IsFullScreen = Config.FullScreen;

            Graphics.SynchronizeWithVerticalRetrace = true;

            // Pass through the FPS capping (60 FPS)
            if (!Config.FpsCapping)
            {
                IsFixedTimeStep = false;
                Graphics.SynchronizeWithVerticalRetrace = false;
            }

            Graphics.ApplyChanges();

            Content.RootDirectory = "Content";

            Components.Add(new InputHandler(this));

            _stateManager = new GameStateManager(this);
            Components.Add(_stateManager);

            // Screens
            TitleScreen = new TitleScreen(this, _stateManager);
            GameConfigurationScreen = new GameConfigurationScreen(this, _stateManager);
            GameplayScreen = new GameplayScreen(this, _stateManager);
            LeaderboardScreen = new LeaderboardScreen(this, _stateManager);
            ImprovementScreen = new ImprovementScreen(this, _stateManager);
            GameOverScreen = new GameOverScreen(this, _stateManager);
            OptionsScreen = new OptionsScreen(this, _stateManager);
            KeyboardInputsScreen = new KeyboardInputsScreen(this, _stateManager);
            GamepadInputsScreen = new GamepadInputsScreen(this, _stateManager);

            _stateManager.ChangeState(TitleScreen);

            // FPS
            Components.Add(new FrameRateCounter(this));
        }
示例#10
0
        public OptionsScreen(Game game, GameStateManager manager)
            : base(game, manager)
        {
            _title = "Options";
            _menuText = new string[]
                {
                    "1P Control",
                    "2P Control",
                    "Sound volume",
                    "Music volume"
                };

            _menuStartCoord = new Point(
                Game.GraphicsDevice.Viewport.Width / 2,
                Game.GraphicsDevice.Viewport.Height / 2 - 100);
        }
示例#11
0
 public GameOverScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
     _content = new List<string>();
 }
示例#12
0
        protected override void Initialize()
        {
            StaticClassSerializer.Load(typeof(PlayerData), "data.bin");

            // Manage inputs like keyboard or gamepad
            Components.Add(new InputHandler(this));

            // Display FPS at the top left screen's corner
            Components.Add(new FrameRateCounter(this));

            _stateManager = new GameStateManager(this);
            Components.Add(_stateManager);

            // Screens
            TitleScreen = new TitleScreen(this, _stateManager);
            DebugScreen = new DebugScreen(this, _stateManager);
            PatternTestScreen = new PatternTestScreen(this, _stateManager);
            GameConfigurationScreen = new GameConfigurationScreen(this, _stateManager);
            GameplayScreen = new GameplayScreen(this, _stateManager);
            LeaderboardScreen = new LeaderboardScreen(this, _stateManager);
            ImprovementScreen = new ImprovementScreen(this, _stateManager);
            GameOverScreen = new GameOverScreen(this, _stateManager);
            OptionsScreen = new OptionsScreen(this, _stateManager);
            KeyboardInputsScreen = new KeyboardInputsScreen(this, _stateManager);
            GamepadInputsScreen = new GamepadInputsScreen(this, _stateManager);

            _stateManager.ChangeState(TitleScreen);

            ParticleManager = new ParticleManager<ParticleState>(1024 * 20, ParticleState.UpdateParticle);

            base.Initialize();
        }
 public ImprovementScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
 }
 public KeyboardInputsScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
     _title = "Keyboard";
 }
 public GameConfigurationScreen(Game game, GameStateManager manager)
     : base(game, manager)
 {
 }