Ejemplo n.º 1
0
        public WinningScreen(Texture2D background, Texture2D buttonTex, SpriteFont font, Color color, Difficulty difficulty,Texture2D control, Player player, bool superShipWasAvailable, bool superShipAvailable, TimeSpan TotalTime, Rectangle window, SoundBank soundBack)
            : base(background, WallpaperType.Streched, buttonTex, font, window, soundBack)
        {
            this.playerTex = player.GetTexture;
            this.control = control;

            this.AddButton("Play Again", color, new Vector2(buttonTex.Width / 2f + buttonTex.Height / 3f, window.Height - buttonTex.Height / 3f));
            this.AddButton("Exit", color, new Vector2(buttonTex.Width * 2f + buttonTex.Height / 3f, window.Height - buttonTex.Height / 3f));

            this.AddLabel("Well Done! You have finished the game!", new Vector2(50));

            float w = window.Width / 2f-150;
            float h = window.Height / 14f;
            float t = 100;

            this.AddLabel("Bullets fired : " + player.GetBulletsFired,new Vector2(w,h+t));
            this.AddLabel("      Accuracy: " + player.GetBulletsAccuracy + "%", new Vector2(w, h * 2 + t));
            this.AddLabel("Missiles fired: " + player.GetMissilesFired, new Vector2(w, h * 3 + t));
            this.AddLabel("      Accuracy: " + player.GetMissilesAccuracy + "%", new Vector2(w, h * 4 + t));
            this.AddLabel("Total Accuracy: " + player.GetTotalAccuracy + "%", new Vector2(w, h * 5 + t));
            this.AddLabel("MidKits Used  : " + player.GetMidkitsUsed, new Vector2(w, h * 6 + t));
            this.AddLabel("Player Score  : " + player.GetPlayerScore , new Vector2(w, h * 7 + t));
            this.AddLabel("Time played     " + TotalTime.Hours +":" + TotalTime.Minutes + ":" + TotalTime.Seconds , new Vector2(w, h * 8 + t));

            this.AddAnimation( new Animation(playerTex, new Point(4, 1),new Vector2(100,window.Height/2f),20,true,font,difficulty.ToString(),window));
            this.AddAnimation( new Animation(control,new Point(1,3),new Vector2(150,window.Height/2f+100),700,false,font,"",window));

            if (superShipAvailable && !superShipWasAvailable)
                this.AddLabel("*Congratulations!! You've unlocked a new ship,The ultimate ship.", new Vector2(100, h * 9f + t));
        }
Ejemplo n.º 2
0
        protected int timeTillNextRBolt = 4000; // Electricity bolt ( right )

        #endregion Fields

        #region Constructors

        public FinalBoss(Texture2D textureImage, Texture2D pulseCannonTex, Texture2D boltCannonTex, Texture2D defendersPlatformTex, Texture2D defenderTex, Texture2D pulseTex, Texture2D boltTex, Player player, Rectangle window, ExplosionManager explosionManager, SoundBank soundBank)
            : base(textureImage, new Point(1, 1),  new Vector2(window.Width / 2f, window.Height + 400), Vector2.Zero, window, explosionManager, soundBank)
        {
            this.pulseCannonTex = pulseCannonTex;
            this.boltCannonTex = boltCannonTex;
            this.defendersPlatformTex = defendersPlatformTex;
            this.defenderTex = defenderTex;
            this.pulseTex = pulseTex;
            this.boltTex = boltTex;

            this.player = player;

            this.explosionDamage = 200f;
            this.explosionRadius = 300f;
            this.scoreOnDeath = 3000;
            this.health = 14000;
            this.materialDensity = 10f;

            this.rotation = (float)Math.PI;

            boltR = new Bolt(boltTex, new Point(1, 4), position - new Vector2(230 + 105 + 10, 15), 60, false, window, explosionManager);
            boltL = new Bolt(boltTex, new Point(1, 4), position + new Vector2(230 + 105 + 10, -15), 60, true, window, explosionManager);

            this.side = Side.Aliens;

            soundBank.PlayCue("FinalBossFlyBy");
        }
Ejemplo n.º 3
0
        protected Rectangle window; // The window to perform OutOfBounds check with

        #endregion Fields

        #region Constructors

        public EnemyManager(Texture2D invaderTex, Texture2D motherShipTex, Texture2D droneTex, Texture2D pulseTex, Texture2D finalBossTex, Texture2D boltTex, Texture2D boltCannonTex, Texture2D pulseCannonTex, Texture2D defendersPlatformTex, Player player, Rectangle window, ExplosionManager explosionManager, SoundBank soundBank)
        {
            this.invaderTex = invaderTex;

            this.motherShipTex = motherShipTex;
            this.droneTex = droneTex;
            this.pulseTex = pulseTex;

            this.finalBossTex = finalBossTex;
            this.boltTex = boltTex;
            this.boltCannonTex = boltCannonTex;
            this.pulseCannonTex = pulseCannonTex;
            this.defendersPlatformTex = defendersPlatformTex;

            this.player = player;

            this.window = window;

            this.explosionManager = explosionManager;
            this.soundBank = soundBank;
        }
Ejemplo n.º 4
0
        public MotherShip(Texture2D textureImage, Texture2D droneTex, Texture2D pulseTex, Vector2 position, Player player, Rectangle window, ExplosionManager explosionManager, SoundBank soundBank)
            : base(textureImage, new Point(1, 1), position, Vector2.Zero, window, explosionManager, soundBank)
        {
            this.droneTex = droneTex;
            this.pulseTex = pulseTex;

            this.side = Side.Aliens;

            this.player = player;

            speed = new Vector2(Math.Sign(player.GetPosition.X - this.position.X) * Math.Abs(player.GetPosition.X - this.position.X) / 200f,
                            Math.Sign(player.GetPosition.Y - this.position.Y) * Math.Abs(player.GetPosition.Y - this.position.Y) / 200f);

            // Calculating rotation
            double m = (position.Y - player.GetPosition.Y) / (position.X - player.GetPosition.X);
            rotation = (float)(Math.Atan(m) - Math.PI / 2f);
            if (player.GetPosition.X > position.X) rotation -= (float)Math.PI;

            this.explosionDamage = 200f;
            this.explosionRadius = 40f;
            this.scoreOnDeath = 400;
            this.health = 200;
            this.materialDensity = 40f;
        }