Пример #1
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            screenRectangle = new Rectangle(0, 0, 1280, 720);

            graphics.PreferredBackBufferWidth  = ScreenRectangle.Width;
            graphics.PreferredBackBufferHeight = ScreenRectangle.Height;

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

            this.IsMouseVisible = true;

            titleIntroState   = new TitleIntroState(this);
            startMenuState    = new MainMenuState(this);
            gamePlayState     = new GamePlayState(this);
            conversationState = new ConversationState(this);
            battleState       = new BattleState(this);

            gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One);

            characterManager = CharacterManager.Instance;
        }
Пример #2
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this)
            {
                SynchronizeWithVerticalRetrace = false,
                PreferredBackBufferWidth       = 800,
                PreferredBackBufferHeight      = 600
            };
            Content.RootDirectory = "Content";

            screenRectangle = new Rectangle(0, 0, 1280, 720);

            graphics.PreferredBackBufferWidth  = ScreenRectangle.Width;
            graphics.PreferredBackBufferHeight = ScreenRectangle.Height;

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

            IsMouseVisible = true;

            titleIntroState = new TitleIntroState(this);
            startMenuState  = new MainMenuState(this);
            gamePlayState   = new GameplayState(this);

            _gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One);
        }
Пример #3
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            screenRectangle = new Rectangle(0, 0, 1280, 720);

            graphics.PreferredBackBufferWidth  = screenRectangle.Width;
            graphics.PreferredBackBufferHeight = screenRectangle.Height;

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

            titleScreenState = new TitleScreenState(this);
            mainMenuState    = new MainMenuState(this);

            gameStateManager.ChangeState((TitleScreenState)titleScreenState, PlayerIndex.One);
        }
Пример #4
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory              = "Content";
            screenRectangle                    = new Rectangle(0, 0, 1280, 720);
            graphics.PreferredBackBufferWidth  = ScreenRectangle.Width;
            graphics.PreferredBackBufferHeight = ScreenRectangle.Height;
            gameStateManager                   = new GameStateManager(this);
            Components.Add(gameStateManager);
            this.IsMouseVisible = true;

            titleIntroState     = new TitleIntroState(this);
            startMenuState      = new MainMenuState(this);
            startSettingsState  = new SettingsState(this);
            startChooseMapState = new ChooseMapState(this);
            startPlayState      = new PlayState(this);

            gameStateManager.ChangeState((TitleIntroState)titleIntroState);
        }
Пример #5
0
        public Avatars()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            screenRectangle = new Rectangle(0, 0, 1280, 720);

            graphics.PreferredBackBufferWidth = ScreenRectangle.Width;
            graphics.PreferredBackBufferHeight = ScreenRectangle.Height;

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

            IsMouseVisible = true;

            titleIntroState = new TitleIntroState(this);
            startMenuState = new MainMenuState(this);

            gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One);
        }
Пример #6
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            // Defining the game window size
            screenRectangle = new Rectangle(0, 0, 1280, 720);
            graphics.PreferredBackBufferWidth  = ScreenRectangle.Width;
            graphics.PreferredBackBufferHeight = ScreenRectangle.Height;

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

            this.IsMouseVisible = true;

            titleIntroState = new TitleIntroState(this);
            mainMenuState   = new MainMenuState(this);

            gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One);
        }
Пример #7
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            screenRectangle = new Rectangle(0, 0, 1280, 720);
            graphics.PreferredBackBufferWidth  = ScreenRectangle.Width;
            graphics.PreferredBackBufferHeight = ScreenRectangle.Height;

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

            Options          = new GameOptions();
            Options.GameType = GameType.TwoPlayerCooperative; // TODO: set this on the menu screen

            titleIntroState = new TitleIntroState(this);
            startMenuState  = new MainMenuState(this);


            gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One);
        }
Пример #8
0
        public void ChangeState(MainMenuState newState)
        {
            if (StateLookup == null)
            {
                CreateStateMachine();
            }

            if (currentState == StateLookup[newState])
            {
                return;
            }

            if (currentState != null)
            {
                currentState.End();
            }


            currentState = StateLookup[newState];
            currentState.Begin();
        }
Пример #9
0
    void Awake()
    {
        ///registration to get music volume's changes
        GameCoreSingletone.Singletone.SettingController.AddNewMusicListener(this);
        foreach(IMainMenuState state in this.GetComponents(typeof(IMainMenuState)))
        {
            state.enabled = false;
            if(state._panel!=null)
            state._panel.gameObject.SetActiveRecursively(false);
        }
        if(_firstState != null)
        {
            _currentState = _firstState;
        }
        else
        {
            _currentState = (IMainMenuState)this.GetComponent(typeof(SplashScreenState));
        }
        _currentState.enabled = true;
        _currentState._panel.gameObject.SetActiveRecursively(true);

        SetNewMusicVolume((float)GameCoreSingletone.Singletone.SettingController.MusicVolume);
    }
Пример #10
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";

            graphics.SynchronizeWithVerticalRetrace = false; //vsync
            graphics.PreferredBackBufferFormat      = SurfaceFormat.Alpha8;
            IsFixedTimeStep = false;
            if (IsFixedTimeStep)
            {
                TargetElapsedTime = TimeSpan.FromMilliseconds(1000.0f / 60);
            }

            SetWindowResolution();
            IsMouseVisible = true;

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

            titleIntroState = new TitleIntroState(this);
            mainMenuState   = new MainMenuState(this);
            gamePlayState   = new GamePlayState(this);
            gameStateManager.ChangeState((TitleIntroState)titleIntroState, PlayerIndex.One);
        }