Ejemplo n.º 1
0
        public override void LoadContent()
        {
            base.LoadContent();
            Field.Instance.LoadContent();

            Song = Content.Load <Song>("Music/gameplay");
            MediaPlayer.Play(Song);

            TimeLimit      = 60;
            CurrentTime    = TimeLimit;
            IsGameFinished = false;

            TimeRectangle          = new Texture((int)(0.8f * Settings.ViewportWidth), 8, Color.Gold);
            TimeRectangle.Position = new Vector2((int)Settings.ScreenCenter.X, (int)Settings.ViewportHeight - 10);
            TimeRectangle.LoadContent();

            Score          = new TextBlock("Fonts/GillSans_32", "SCORE: 0");
            Score.Color    = Color.PaleGoldenrod;
            Score.Position = new Vector2(Settings.ScreenCenter.X, 30);
            Score.LoadContent();

            TimerText          = new TextBlock("Fonts/GillSans_28", "60");
            TimerText.Position = new Vector2(TimeRectangle.Position.X, TimeRectangle.Position.Y - 20.0f);
            TimerText.LoadContent();

            Background          = new Texture("Sprites/Backgrounds/background");
            Background.Scale    = new Vector2(0.8f);
            Background.Position = Settings.ScreenCenter;
            Background.LoadContent();

            ScreenObjects.Add(Score);
            ScreenObjects.Add(TimerText);
            ScreenObjects.Add(Background);
            ScreenObjects.Add(TimeRectangle);
        }
Ejemplo n.º 2
0
        public override void LoadContent()
        {
            base.LoadContent();
            Score.LoadContent();

            Song = Content.Load <Song>("Music/gameover");
            MediaPlayer.Play(Song);

            OkButton = new Button(
                new Texture("Sprites/Buttons/button"),
                new TextBlock("Fonts/GillSans_28", "OK"),
                new Vector2(Settings.ScreenCenter.X, Settings.ScreenCenter.Y + Score.Height + 30.0f)
                );
            OkButton.Texture.Click += OkButton_Click;
            OkButton.LoadContent();

            GameOverText          = new TextBlock("Fonts/GillSans_48", "GAME OVER");
            GameOverText.Position = new Vector2(Settings.ScreenCenter.X, Settings.ScreenCenter.Y - Score.Height - 20.0f);
            GameOverText.Color    = Color.Gold;
            GameOverText.LoadContent();

            Background          = new Texture("Sprites/Backgrounds/background");
            Background.Scale    = new Vector2(0.8f);
            Background.Position = Settings.ScreenCenter;
            Background.LoadContent();

            ScreenObjects.Add(Score);
            ScreenObjects.Add(Background);
            ScreenObjects.Add(GameOverText);
            ScreenObjects.Add(OkButton.Texture);
            ScreenObjects.Add(OkButton.Caption);
        }
Ejemplo n.º 3
0
        public override void LoadContent()
        {
            base.LoadContent();

            Song = Content.Load <Song>("Music/start");
            MediaPlayer.Play(Song);

            PlayButton = new Button(
                new Texture("Sprites/Buttons/button"),
                new TextBlock("Fonts/GillSans_28", "PLAY"),
                Settings.ScreenCenter
                );
            PlayButton.Texture.Click += PlayButton_Click;
            PlayButton.LoadContent();

            Background          = new Texture("Sprites/Backgrounds/background");
            Background.Scale    = new Vector2(0.8f);
            Background.Position = Settings.ScreenCenter;
            Background.LoadContent();

            ScreenObjects.Add(Background);
            ScreenObjects.Add(PlayButton.Texture);
            ScreenObjects.Add(PlayButton.Caption);
        }