/// <summary>
        /// Load the game over screen
        /// </summary>
        public override void Load()
        {
            GridStyle       = GridStyles.Ticks;
            BackgroundColor = Color.Black;
            FontName        = "QuartzMS";

            // Add the score text
            ScoreText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale         = .4f,
                Position      = new Vector2(-100f, 100f),
                Color         = Color.White
            });

            // Add the start key text
            RestartText = AddText(new Text
            {
                Value            = "Press SPACE to Play",
                Position         = new Vector2(0f, -100f),
                Alignment        = HorizontalAlignments.Center,
                VerticalAlign    = VerticalAlignments.Bottom,
                AnimationType    = TextAnimations.Typewriter,
                AnimationSeconds = 0.2,
                Scale            = 0.5f,
                Color            = Color.Lime
            });
            if (Game.Platform == GamePlatforms.XBox)
            {
                RestartText.Value = "Press START to Play";
            }
            else if (Game.Platform == GamePlatforms.WindowsPhone)
            {
                RestartText.Value = "TAP to Play";
            }

            missile = AddSprite <MissileSprite>();
            missile.SetCostume("ufo");
            missile.Costume.YCenter = VerticalAlignments.Center;
            missile.Scale           = 2;
            missile.Show();
            missile.X = 0;
            missile.Y = 50;

            barrier       = AddSprite <BarrierSprite>();
            barrier.Scale = 2.5f;
            barrier.Y     = -70;

            ufo                 = AddSprite <UfoSprite>();
            ufo.Position        = Vector2.Zero;
            ufo.Costume.YCenter = VerticalAlignments.Top;
            ufo.Scale           = 1;
            ufo.Show();
        }
Exemple #2
0
 public void HitBarrier(BarrierSprite Barrier)
 {
     SetCostume("AlienBullets/AlienMissileHitBarrier");
     Barrier.Stamp(this, StampMethods.Cutout);
     State = MissileStates.Destroy;
 }
        /// <summary>
        /// Load the screen
        /// </summary>
        public override void Load()
        {
            BackgroundColor = Color.Black;
            FontName        = "QuartzMS";
            AddSound("shoot");
            AddSound("ufo");
            AddSound("UfoDeath");
            AddSound("AlienDeath");
            AddSound("AlienMove1");
            AddSound("AlienMove2");
            AddSound("AlienMove3");
            AddSound("AlienMove4");

            // Create our sprites
            ship     = AddSprite <ShipSprite>();
            barrier1 = AddSprite <BarrierSprite>();
            barrier2 = AddSprite <BarrierSprite>();
            barrier3 = AddSprite <BarrierSprite>();
            barrier4 = AddSprite <BarrierSprite>();
            missile  = AddSprite <MissileSprite>();
            ufo      = AddSprite <UfoSprite>();
            //line = AddSprite<LineSprite>();

            // Position the barriers
            barrier1.X = -60;
            barrier2.X = -20;
            barrier3.X = 20;
            barrier4.X = 60;

            // Create our texts
            Player1ScoreText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Top,
                Scale         = 0.4f,
                Position      = new Vector2(-100f, 100f),
                Color         = Color.White,
                Value         = "Player 1 Score: " + SpaceInvaders.Player1Score
            });

            Player2ScoreText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Right,
                VerticalAlign = VerticalAlignments.Top,
                Scale         = 0.4f,
                Position      = new Vector2(100f, 100f),
                Color         = Color.White,
                Value         = "Player 2 Score: " + SpaceInvaders.Player2Score
            });

            HighScoreText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Top,
                Scale         = .4f,
                Position      = new Vector2(0, 100f),
                Color         = Color.White
            });

            PlayerNumberText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Center,
                VerticalAlign = VerticalAlignments.Center,
                Scale         = 1f,
                Position      = new Vector2(0, 0),
                Color         = Color.Lime,
                Visible       = false
            });

            LevelText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Right,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale         = .4f,
                Position      = new Vector2(100f, -100f),
                Color         = Color.White
            });

            shipStatusText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale         = 0.5f,
                Position      = new Vector2(-100f, -100f),
                Color         = new Color(1.0f, .2f, .9f, .5f)
            });

            DebugText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Right,
                VerticalAlign = VerticalAlignments.Top,
                Scale         = 0.4f,
                Position      = new Vector2(100f, 100f),
                Color         = Color.YellowGreen
            });

            LivesText = AddText(new Text
            {
                Alignment     = HorizontalAlignments.Left,
                VerticalAlign = VerticalAlignments.Bottom,
                Scale         = .4f,
                Position      = new Vector2(-100f, -100f),
                Color         = Color.White,
                Value         = "Lives: "
            });
        }