Exemplo n.º 1
0
        // CONSTRUCTOR
        public MenuGame()
        {
            started = false;
            died = false;
            over = false;

            menuButton = new Button(sprite, new Point(60, 21), new Rectangle(558, 212, 40, 14));
            pauseButton = new Button(sprite, new Point(Game1.screenWidth - 13 * 3 / 2, 14 * 3 / 2), new Rectangle(558, 143, 13, 14));
            resumeButton = new Button(sprite, new Point(Game1.screenWidth - 13 * 3 / 2, 14 * 3 / 2), new Rectangle(571, 143, 13, 14));

            actualScore = new Score(Game1.screenWidth / 2, Game1.screenHeight / 2 - 192, true);
            totalScore = 0;
            newScore = false;
            writed = false;

            getReadySource = new Rectangle(584, 135, 87, 22);
            getReady = new Rectangle(Game1.screenWidth / 2 - getReadySource.Width * 3 / 2, Game1.screenHeight / 2 - getReadySource.Height * 3 / 2 - 128, getReadySource.Width * 3, getReadySource.Height * 3);
            startTipSource = new Rectangle(558, 58, 19, 37);
            startTip = new Rectangle(Game1.screenWidth / 2 - startTipSource.Width, Game1.screenHeight / 2 - startTipSource.Height, startTipSource.Width * 2, startTipSource.Height * 2);
            spaceTipSource = new Rectangle(577, 58, 31, 15);
            spaceTip = new Rectangle(startTip.X + startTip.Width + 16, startTip.Y + 47, spaceTipSource.Width * 3, spaceTipSource.Height * 3);

            txtScore = new string[2];
            txtScore[0] = "|Flappy Bird Save|";
        }
Exemplo n.º 2
0
        // CONSTRUCTOR
        public MenuMain()
        {
            logoSource = new Rectangle(558, 157, 96, 22);
            logoPosition = new Vector2(Game1.screenWidth / 2 - logoSource.Width * 3 / 2, Game1.screenHeight / 2 - logoSource.Height * 3 / 2 - 128);
            logoSize = new Vector2(logoSource.Width * 3, logoSource.Height * 3);

            highScoreSource = new Rectangle(558, 282, 69, 7);
            highScoreRectangle = new Rectangle(8, 8, highScoreSource.Width * 3, highScoreSource.Height * 3);
            score = new Score(highScoreRectangle.X + highScoreRectangle.Width + 48, highScoreRectangle.Y, false);

            startButton = new Button(sprite, new Point(Game1.screenWidth / 2, Game1.screenHeight / 2), new Rectangle(558, 198, 40, 14));
            quitButton = new Button(sprite, new Point(Game1.screenWidth / 2, startButton.ButtonY + startButton.ButtonHeight * 2), new Rectangle(558, 268, 40, 14));
        }
Exemplo n.º 3
0
        // CONSTRUCTOR
        public MenuGameOver()
        {
            texture = RessourcesManager.sprite;
            loaded = false;

            titleSource = new Rectangle(558, 179, 94, 19);
            title = new Rectangle(Game1.screenWidth / 2 - titleSource.Width * 3 / 2, 0 - titleSource.Height * 3, titleSource.Width * 3, titleSource.Height * 3);

            boxSource = new Rectangle(558, 0, 113, 58);
            box = new Rectangle(Game1.screenWidth / 2 - boxSource.Width * 3 / 2, Game1.screenHeight, boxSource.Width * 3, boxSource.Height * 3);

            retryButton = new Button(texture, new Point(Game1.screenWidth / 2, Game1.screenHeight / 2 + box.Height / 2 + 32), new Rectangle(558, 226, 40, 14));
            menuButton = new Button(texture, new Point(Game1.screenWidth / 2, retryButton.ButtonY + 80), new Rectangle(558, 212, 40, 14));

            highScore = MenuBase.HighScore;
            score = MenuBase.TotalScore;

            if (MenuBase.NewScore && score > 50)
            {
                medalLevel = 0;
                highSound = RessourcesManager.gold;
            }
            else if (MenuBase.NewScore && score > 25)
            {
                medalLevel = 1;
                highSound = RessourcesManager.gold;
            }
            else if (MenuBase.NewScore)
            {
                medalLevel = 2;
                highSound = RessourcesManager.gold;
            }
            else
            {
                medalLevel = 3;
                highSound = null;
            }
            medal = new Medal(medalLevel, new Point((Game1.screenWidth / 2 - boxSource.Width * 3 / 2) + 13 * 3, (Game1.screenHeight / 2 - boxSource.Height * 3 / 2) + 21 * 3));

            writeScore = new Score((Game1.screenWidth / 2 - boxSource.Width * 3 / 2) + 92 * 3, (Game1.screenHeight / 2 - boxSource.Height * 3 / 2) + 17 * 3, false);
            writeBest = new Score((Game1.screenWidth / 2 - boxSource.Width * 3 / 2) + 92 * 3, (Game1.screenHeight / 2 - boxSource.Height * 3 / 2) + 38 * 3, false);

            newScoreSource = new Rectangle(617, 58, 16, 7);
            newScore = new Rectangle((Game1.screenWidth / 2 - boxSource.Width * 3 / 2) + 60 * 3, (Game1.screenHeight / 2 - boxSource.Height * 3 / 2) + 8 * 3, newScoreSource.Width * 3, newScoreSource.Height * 3);
            soundPlayed = false;
        }