Beispiel #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.
            TextureManager.setDebug(true);

            spriteBatch = new SpriteBatch(GraphicsDevice);
            TextureManager.loadAllImages(Content);
            GlobalCamera = new LCamera(graphics.GraphicsDevice, spriteBatch, Settings.TargetRectangle, Settings.GP_P);
            Camera.setupCamera(Settings.GP_P);
            Camera.setupGenericTexture(GraphicsDevice);
            SafeImage.SetPlaceholder(new Image("phld"));
            ControllerDisplayHelper.Load();
            TemporaryPlayer.LOAD();
            Screen.Load(Content);
            Settings.Load();
            ScreenManager = new GameScreenManager();
            Screens.MinigameScreen.Load(Content);

            //Settings.DEBUG_CONTROLLERS = true;

            //DEBUGGING:

            Settings.UPDATE_GT = new GameTime(TimeSpan.Zero, TimeSpan.Zero);

            GameManager.Setup(new Player[] { new Player("TST P", Difficulty.NON_COMP, PlayerIndex.One),
                                             new Player("CMP E", Difficulty.Easy, PlayerIndex.Two),
                                             new Player("CMP M", Difficulty.Medium, PlayerIndex.Three),
                                             new Player("CMP H", Difficulty.Hard, PlayerIndex.Four) });
            GameManager.ChangeP1(GameManager.Players[2], 0);
            ScreenManager.ChangeScreen(new Screens.MinigameScreen(
                                           Screens.MinigameScreen.AllMinigames[2], // Minigame goes here
                                           GameManager.Players));

            // END DEBUGGING
        }
Beispiel #2
0
        /// <summary>
        /// This is called when the game should draw itself.
        /// </summary>
        /// <param name="gameTime">Provides a snapshot of timing values.</param>
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.Black);
            GlobalCamera.Begin();

            ScreenManager.Draw(gameTime, spriteBatch);

            if (Settings.DEBUG_CONTROLLERS && GameManager.Players != null && GameManager.Players[0] != null)
            {
                for (int x = 0; x < 4; x++)
                {
                    ControllerDisplayHelper.RENDER_CONTROLLER(spriteBatch, GameManager.Players[x].GamePad.BaseCurrent(), Settings.PlayerCAreas[x], GameManager.Players[x].PlayerColor);
                }
            }

            GlobalCamera.End();
            base.Draw(gameTime);
        }
Beispiel #3
0
        private static void RECALC_TGT_RECT()
        {
            double TgtRes    = GP_X / (double)GP_Y;
            double ActualRes = Screen_X / (double)Screen_Y;

            if (TgtRes > ActualRes)
            {
                //TGTX adj
                TargetRectangle.Width  = Screen_X;
                TargetRectangle.Height = (int)(TargetRectangle.Width / TgtRes);
                TargetRectangle.Y     += (Screen_Y - TargetRectangle.Height) / 2;
            }
            else if (TgtRes == ActualRes)
            {
                TargetRectangle = new Rectangle(0, 0, Screen_X, Screen_Y);
            }
            else
            {
                //TGTY adj
                TargetRectangle.Height = Screen_Y;
                TargetRectangle.Width  = (int)(TgtRes * (double)TargetRectangle.Height);
                TargetRectangle.X     += (Screen_X - TargetRectangle.Width) / 2;
            }



            PlayerCAreas = new Rectangle[4];
            int Wid     = GP_X / 5;
            int spacing = Wid / 5;

            for (int i = 0; i < 4; i++)
            {
                PlayerCAreas[i]   = new Rectangle(0, 0, Wid, (int)(ControllerDisplayHelper.GETAR() * Wid));
                PlayerCAreas[i].X = spacing + (Wid + spacing) * i;
            }
        }