Exemple #1
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);


            // TODO: use this.Content to load your game content here
            mGameScreen        = new GameScreen(this.Content, screenRectangle, new EventHandler(GameScreenEvent));
            mTitleScreen       = new TitleScreen(this.graphics, this.Content, new EventHandler(TitleScreenEvent));
            mPauseScreen       = new PauseScreen(this.graphics, this.Content, new EventHandler(PauseScreenEvent));
            mMainMenuScreen    = new MainMenuScreen(this.graphics, this.Content, new EventHandler(MainMenuScreenEvent));
            mChooseLevelScreen = new ChooseLevelScreen(this.graphics, this.Content, new EventHandler(ChooseLevelScreenEvent));

            mCurrentScreen = mTitleScreen;
        }
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //graphics.ToggleFullScreen();

            screenState = ScreenState.Title;

            gameScreen     = new GameScreen();
            mainMenuScreen = new MainMenuScreen();
            titleScreen    = new TitleScreen();
            gameOverScreen = new GameOverScreen();
            //playerSelectScreen = new PlayerSelectScreen();
            oneplayerSelectScreen = new OnePlayerSelectScreen();
            twoplayerSelectScreen = new TwoPlayerSelectScreen();
            onlineOptionsScreen   = new OnlineOptionsScreen();
            onlineJoinScreen      = new OnlineJoinScreen();
            optionsScreen         = new OptionsScreen();
            editControls          = new EditControlsScreen();
            pauseScreen           = new PauseScreen();
            errorScreen           = new ErrorScreen();
            gameModeScreen        = new GameModeScreen();
            keyboardScreen        = new KeyboardScreen();
            waitingScreen         = new WaitingScreen();



            graphics.PreferredBackBufferWidth  = 1920;
            graphics.PreferredBackBufferHeight = 1080;
            graphics.ApplyChanges();


            Global.Scale = new Vector2(GraphicsDevice.Viewport.Width / 1920f);

            InputManager.Update();
            Global.UsingKeyboard = !InputManager.PressedKeysPlayer1.IsConnected;
            IsMouseVisible       = true;
            base.Initialize();
        }
Exemple #3
0
        private void MainForm_Load(object sender, EventArgs e) // new splash/titlescreen
        {
            TitleScreen Splash = new TitleScreen();

            Splash.Show();
        }