예제 #1
0
        public override void Update()
        {
            base.Update();

            Menu.Update();
            if (Menu.Press())
            {
                SceneManager.ChangeScene(SceneManager.menuScene);
                SceneManager.started = false;
            }

            Quit.Update();
            if (Quit.Press())
            {
                Game1.Quit();
            }

            if (Globals.Randomizer.Next(0, 101) < 3 && timer < 0)
            {
                timer             = 15;
                fireworksPosition = new Vector2(Globals.Randomizer.Next(100, Globals.ScreenSize.X - 100), Globals.Randomizer.Next(100, Globals.ScreenSize.Y - 100));
                SoundManager.victory.Play();
            }

            timer--;
            if (timer > 0)
            {
                for (int i = 0; i < Globals.Randomizer.Next(30, 50); i++)
                {
                    SceneManager.GameObjects.Add(new Firework(fireworksPosition));
                }
            }
        }
예제 #2
0
        public override void Update()
        {
            base.Update();
            SceneManager.mapScene.KilledPlayer.UpdateGameOver();

            Quit.Update();
            if (Quit.Press())
            {
                Game1.Quit();
            }

            Menu.Update();
            if (Menu.Press())
            {
                SceneManager.ChangeScene(SceneManager.menuScene);
                SceneManager.started = false;
            }
        }
예제 #3
0
        public override void Update()
        {
            // Title
            if (titleSizeFlip)
            {
                if (titleSize > 1f)
                {
                    titleSize -= 0.0007f;
                }
                else
                {
                    titleSize = MathHelper.Lerp(titleSize, 0.9f, 0.009f);
                }
                if (titleSize < 0.91f)
                {
                    titleSizeFlip = !titleSizeFlip;
                }
            }
            else
            {
                if (titleSize < 1f)
                {
                    titleSize += 0.0007f;
                }
                else
                {
                    titleSize = MathHelper.Lerp(titleSize, 1.1f, 0.009f);
                }
                if (titleSize > 1.09f)
                {
                    titleSizeFlip = !titleSizeFlip;
                }
            }

            Start.Update();
            if (Start.Press())
            {
                SceneManager.ChangeScene(SceneManager.shipSelectScene);
                SceneManager.mapScene.NewItems.Flash = -1;
                SceneManager.mapScene.NewRank.Flash  = -1;
                SoundManager.ChangeMusic(SoundManager.map);
            }

            if (SceneManager.started)
            {
                Continue.Update();
                if (Continue.Press())
                {
                    SceneManager.ChangeScene(SceneManager.mapScene);
                    SoundManager.ChangeMusic(SoundManager.map);
                }
            }

            Options.Update();
            if (Options.Press())
            {
                SceneManager.ChangeScene(SceneManager.optionsScene);
            }

            Quit.Update();
            if (Quit.Press())
            {
                Game1.Quit();
            }

            // Rocks
            Score = MathHelper.Lerp(Score, LerpScore, 0.05f);

            if (Globals.Randomizer.Next(0, 101) < 2)
            {
                GameObjects.Add(new MenuRock());
            }

            foreach (GameObject go in GameObjects)
            {
                go.Update();
            }

            for (int i = GameObjects.Count - 1; i >= 0; i--)
            {
                if (GameObjects[i].Dead)
                {
                    if (GameObjects[i].GetType().Name == "MenuRock")
                    {
                        MenuRock rock = (MenuRock)GameObjects[i];
                        if (rock.MouseKill)
                        {
                            LerpScore += 100;
                            for (int j = 0; j < Globals.Randomizer.Next(5, 8); j++)
                            {
                                GameObjects.Add(new Piece(GameObjects[i].Position, GameObjects[i].Texture, 60, 1));
                            }
                        }
                    }
                    GameObjects.RemoveAt(i);
                }
            }
        }