Beispiel #1
0
        public override void Start()
        {
            base.Start();

            Vector2 center = new Vector2(Game.Window.OrthoWidth / 2, Game.Window.OrthoHeight / 2);

            guiBackground     = new GUIItem(center, "blueBackground");
            gameOverBomberman = new GUIItem(center - new Vector2(0, Game.Window.OrthoHeight / 8), "gameOverBomberman");
            gameOverLabel     = new GUIItem(center + new Vector2(0, Game.Window.OrthoHeight / 8), "gameOverLabel");

            guiToSelect = new List <GUIItem>();
            GUIItem continueGui = new GUIItem(gameOverLabel.Position + new Vector2(0, Game.Window.OrthoHeight / 8), "continue");
            GUIItem quitGui     = new GUIItem(continueGui.Position + new Vector2(0, Game.Window.OrthoHeight / 8), "quit");

            guiToSelect.Add(continueGui);
            guiToSelect.Add(quitGui);
            guiSelectedIndex = 0;
            nextInput        = 0;

            AddGameObjects(guiBackground);
            AddGameObjects(gameOverBomberman);
            AddGameObjects(gameOverLabel);
            AddGameObjects(continueGui);
            AddGameObjects(quitGui);
        }
Beispiel #2
0
        public static void Init(List <Player> players)
        {
            guiScores   = new Dictionary <Player, GuiNumber>();
            guiPowerUps = new Dictionary <Player, List <GUIItem> >();

            for (int i = 0; i < players.Count; i++)
            {
                Player  currPlayer = players[i];
                GUIItem guiImage   = new GUIItem(currPlayer.GUIPosition, currPlayer.GUIImage);

                Vector2 scorePosition = guiImage.Position + new Vector2(0, guiImage.Height / 2) + new Vector2(-2, 2);
                guiScores[currPlayer] = new GuiNumber(scorePosition, "0000000");

                guiPowerUps[currPlayer] = new List <GUIItem>();
                int     numPowerUps = Enum.GetValues(typeof(PowerUpType)).Length;
                Vector2 offset      = new Vector2(0, 1);

                for (int j = 0; j < numPowerUps; j++)
                {
                    PowerUpType type = (PowerUpType)j;
                    GUIItem     g    = new PowerUpGUIItem(scorePosition + offset, type);
                    guiPowerUps[currPlayer].Add(g);
                    offset += new Vector2(1, 0);
                }
            }
        }
Beispiel #3
0
        private void SelectGUIOperation(int index)
        {
            if (guiSelected != null)
            {
                guiSelected.GetSprite().SetMultiplyTint(Vector4.One);
            }

            guiSelectedIndex = index;
            guiSelected      = guiToSelect[index];
            guiSelected.GetSprite().SetMultiplyTint(0, 2, 0, 1);
        }
Beispiel #4
0
        public override void Enter()
        {
            base.Enter();

            startLabel = new GUIItem(new OpenTK.Vector2(Game.Window.OrthoWidth / 2, Game.Window.OrthoHeight / 2), "start");
            timeToDeactiveStartLabel = 1.5f;

            audioSource = new AudioSource();
            audioSource.Play(AudioManager.GetAudioClip("start"));

            AudioManager.SetBackgroundAudio("backgroundMusic");
            AudioManager.DisposeAudioSource(audioSource);
        }
Beispiel #5
0
        public override void Enter()
        {
            base.Enter();

            AudioManager.StopBackground();

            for (int i = 0; i < PlayScene.Players.Count; i++)
            {
                PlayScene.Players[i].Win();
            }

            AudioManager.SetBackgroundAudio("winner");
            labelWin = new GUIItem(new Vector2(Game.Window.OrthoWidth / 2, Game.Window.OrthoHeight / 2), "win");
        }
Beispiel #6
0
        public void SetNumber(string number)
        {
            for (int i = 0; i < this.number.Count; i++)
            {
                this.number[i].Destroy();
            }

            this.number.Clear();

            Vector2 startPos = spritePosition;

            for (int i = 0; i < number.Length; i++)
            {
                GUIItem currNum           = new GUIItem(startPos, "number_" + number[i]);
                currNum.GetSprite().scale = scale;

                this.number.Add(currNum);
                startPos += new Vector2(1 * scale.X, 0);
            }
        }