Ejemplo n.º 1
0
        public MainMenuScreen(ScreenManager screenManager)
            : base(screenManager)
        {
            TransitionDuration = TimeSpan.FromSeconds(1);

            // setup the play button
            int playButtonWidth = screenManager.Game.WorldViewport.Width / 5;
            int playButtonHeight = screenManager.Game.WorldViewport.Height / 10;
            playButton = new Button(this, "Play!", Color.White, new Rectangle(screenManager.Game.WorldViewport.Width / 2 - playButtonWidth / 2, screenManager.Game.WorldViewport.Height / 2 - playButtonHeight / 2, playButtonWidth, playButtonHeight), Color.Green);
            playButton.Selected += playButton_Selected;

            // setup the store button
            int storeButtonWidth = screenManager.Game.WorldViewport.Width / 5;
            int storeButtonHeight = screenManager.Game.WorldViewport.Height / 10;
            storeButton = new Button(this, "Store", Color.White, new Rectangle(screenManager.Game.WorldViewport.Width / 2 - storeButtonWidth / 2, screenManager.Game.WorldViewport.Height / 2 - storeButtonHeight / 2 + (int)(playButtonHeight * 1.1f), storeButtonWidth, storeButtonHeight), Color.Green);
            storeButton.Selected += storeButton_Selected;

            // setup the log in button
            string logInButtonText = !screenManager.Game.IsLoggedIn ? "Log In" : "Log Out";
            Vector2 logInButtonSize = new Vector2(screenManager.Game.GraphicsManager.SpriteFont.MeasureString(logInButtonText).X * 1.1f);
            logInButton = new Button(this, logInButtonText, Color.White, new Rectangle((int)(screenManager.Game.WorldViewport.Width * 0.975f - logInButtonSize.X), (int)(screenManager.Game.WorldViewport.Height * 0.025f), (int)logInButtonSize.X, (int)logInButtonSize.Y), new Color(59, 89, 152));
            logInButton.Selected += logInButton_Selected;

            // Setup the audio mute button
            string audioButtonText = ScreenManager.Game.AudioManager.Muted ? "Audio: Off" : "Audio: On";
            Vector2 audioButtonSize = new Vector2(screenManager.Game.GraphicsManager.SpriteFont.MeasureString(audioButtonText).X * 1.1f);
            audioButton = new Button(this, audioButtonText, Color.White, new Rectangle((int)(screenManager.Game.WorldViewport.Width * 0.025f), (int)(screenManager.Game.WorldViewport.Height * 0.975f - audioButtonSize.Y), (int)audioButtonSize.X, (int)audioButtonSize.Y), Color.Red);
            audioButton.Selected += audioButton_Selected;

            playerPictureRectangle = new Rectangle((int)(screenManager.Game.WorldViewport.Width * 0.975f - 2 * logInButtonSize.X), (int)(screenManager.Game.WorldViewport.Height * 0.025f), (int)logInButtonSize.X, (int)logInButtonSize.Y);

            blockRain = new BlockRain(this);
        }
Ejemplo n.º 2
0
        public GameplayScreen(ScreenManager screenManager)
            : base(screenManager)
        {
            TransitionDuration = TimeSpan.FromSeconds(1);

            board = new Board(this);
            hud = new HUD(this, board);
            menuButton = new Button(this, "Menu", Color.White, new Rectangle(45, 45, 75, 75), Color.Red);
            menuButton.Selected += menuButton_Selected;
        }
Ejemplo n.º 3
0
        public StoreScreen(ScreenManager screenManager)
            : base(screenManager)
        {
            TransitionDuration = TimeSpan.FromSeconds(1);

            // setup the big ups button
            string bigUpsButtonText = "Send Big Ups to Omega Entertainment (FREE!)";
            int bigUpsButtonWidth = (int)(screenManager.Game.GraphicsManager.SpriteFont.MeasureString(bigUpsButtonText).X * 1.1f);
            int bigUpsButtonHeight = screenManager.Game.WorldViewport.Height / 10;
            bigUpsButton = new Button(this, bigUpsButtonText, Color.White, new Rectangle(screenManager.Game.WorldViewport.Width / 2 - bigUpsButtonWidth / 2, screenManager.Game.WorldViewport.Height / 2 - bigUpsButtonHeight / 2, bigUpsButtonWidth, bigUpsButtonHeight), Color.Red);
            bigUpsButton.Selected += bigUpsButton_Selected;

            // setup the back button
            string backButtonText = "Back";
            Vector2 backButtonSize = new Vector2(screenManager.Game.GraphicsManager.SpriteFont.MeasureString(backButtonText).X * 1.1f);
            backButton = new Button(this, backButtonText, Color.White, new Rectangle((int)(screenManager.Game.WorldViewport.Width * 0.025f), (int)(screenManager.Game.WorldViewport.Height * 0.025f), (int)backButtonSize.X, (int)backButtonSize.Y), Color.Orange);
            backButton.Selected += backButton_Selected;
            licenseInformation = CurrentAppSimulator.LicenseInformation;
        }        
Ejemplo n.º 4
0
        /// <summary>
        /// Construct the board
        /// </summary>
        /// <param name="graphicsDevice"></param>
        public Board(Screen screen)
        {
            Screen = screen;   

            // Create the board
            Blocks = new Block[Rows, Columns];
            for (int row = 0; row < Rows; row++)
            {
                for (int column = 0; column < Columns; column++)
                {
                    Blocks[row, column] = new Block(this, Screen, row, column);

                    // Only fill the first bottom Rows
                    if (row < initialEmptyRows)
                    {
                        Blocks[row, column].Empty();
                    }
                    else
                    {
                        Blocks[row, column].Create();
                    }
                }
            }

            // Create the next row of Blocks
            NextBlocks = new Block[Columns];
            for (int column = 0; column < Columns; column++)
            {
                NextBlocks[column] = new Block(this, Screen, Rows, column);
                NextBlocks[column].Create();
                NextBlocks[column].State = Block.BlockState.Preview;
            }

            CelebrationManager = new CelebrationManager(this);

            Renderer = new BoardRenderer(this);
            controller = new BoardController(this);
            Stats = new BoardStats(this);

            RaiseRate = (double)Stats.Level / 4;

            // Initialize buttons
            retryButton = new Button(screen, "Retry", Color.White, new Rectangle(Renderer.Rectangle.X + Renderer.Rectangle.Width / 4 - 50, Renderer.Rectangle.Y + Renderer.Rectangle.Height - 150, Renderer.Rectangle.Width / 4, 100), Color.Orange);
            retryButton.Selected += retryButton_Selected;

            doneButton = new Button(screen, "Done", Color.White, new Rectangle(Renderer.Rectangle.X + Renderer.Rectangle.Width / 2 + 50, Renderer.Rectangle.Y + Renderer.Rectangle.Height - 150, Renderer.Rectangle.Width / 4, 100), Color.Orange);
            doneButton.Selected += doneButton_Selected;
        }