コード例 #1
0
 public ProjectileAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height, int worth,
                        int health, Color color, OnItemCollect itemCollected, ProjectileType projectileFired, float secondsRecharge)
     : base(img, eyeImg, x, y, width, height, worth, health, color, itemCollected)
 {
     this.projectileFired = projectileFired;
     launchTimer          = new Timer(secondsRecharge, TimerUnits.Seconds);
 }
コード例 #2
0
 public NormalAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                    OnItemCollect itemCollected)
     : base(img, eyeImg, x, y, width, height, GameInfo.NORMAL_ALIEN_WORTH, GameInfo.NORMAL_ALIEN_HEALTH,
            Color.Lime, itemCollected)
 {
     Type = Aliens.Normal;
     AddPotentialDrop(Material.Stone, 10);
     AddPotentialDrop(Badge.Green, 5);
 }
コード例 #3
0
        public NinjaAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                          OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.NINJA_ALIEN_WORTH, GameInfo.NINJA_ALIEN_HEALTH,
                   Color.White, itemCollected, ProjectileType.Shuriken, 3.5f)
        {
            Defense = GameInfo.NORMAL_DEFENSE;

            AddPotentialDrop(Material.Metal, 10);
            Type = Aliens.Ninja;
        }
コード例 #4
0
        public FreezeProofAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                                OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.FREEZE_PROOF_ALIEN_WORTH,
                   GameInfo.FREEZE_PROOF_ALIEN_HEALTH, new Color(0, 255, 255), itemCollected)
        {
            canBeFrozen = false;
            Defense     = GameInfo.NORMAL_DEFENSE;

            AddPotentialDrop(Material.Ice, 30);

            Type = Aliens.FreezeProof;
        }
コード例 #5
0
        public HDefenseAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                             OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.HDEFENSE_ALIEN_WORTH, GameInfo.HDEFENSE_ALIEN_HEALTH,
                   new Color(0, 120, 255), itemCollected)
        {
            Defense = GameInfo.HEAVY_DEFENSE;

            AddPotentialDrop(Material.Metal, 30);
            AddPotentialDrop(Badge.Blue, 15);

            Type = Aliens.HDefense;
        }
コード例 #6
0
        public LDefenseAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                             OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.LDEFENSE_ALIEN_WORTH, GameInfo.LDEFENSE_ALIEN_HEALTH,
                   Color.SkyBlue, itemCollected)
        {
            Defense = GameInfo.LIGHT_DEFENSE;

            AddPotentialDrop(Material.Metal, 20);
            AddPotentialDrop(Badge.Blue, 5);

            Type = Aliens.LDefense;
        }
コード例 #7
0
        public HPlasmaResistantAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                                     OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.HPLASMA_RESIST_ALIEN_WORTH,
                   GameInfo.HPLASMA_RESIST_ALIEN_HEALTH, new Color(70, 70, 255), itemCollected)
        {
            PlasmaDefense = GameInfo.HEAVY_DEFENSE;
            Defense       = GameInfo.HEAVY_DEFENSE;

            AddPotentialDrop(Material.Plasma, 30);
            AddPotentialDrop(Badge.Purple, 15);

            Type = Aliens.HPlasmaResistant;
        }
コード例 #8
0
        public HPoisonResistantAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                                     OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.HPOISON_RESIST_ALIEN_WORTH,
                   GameInfo.HPOISON_RESIST_ALIEN_HEALTH, new Color(255, 227, 0), itemCollected)
        {
            PoisonDefense = GameInfo.HEAVY_DEFENSE;
            Defense       = GameInfo.HEAVY_DEFENSE;

            AddPotentialDrop(Material.PlantMatter, 30);
            AddPotentialDrop(Badge.Yellow, 15);

            Type = Aliens.HPoisonResistant;
        }
コード例 #9
0
        public HFireDefenseAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                                 OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.HFIRE_DEFENSE_ALIEN_WORTH, GameInfo.HFIRE_DEFENSE_ALIEN_HEALTH,
                   Color.DarkOrange, itemCollected)
        {
            FireDefense = GameInfo.HEAVY_DEFENSE;
            Defense     = GameInfo.HEAVY_DEFENSE;

            AddPotentialDrop(Material.EssenceOfFire, 30);
            AddPotentialDrop(Badge.Orange, 15);

            Type = Aliens.HFireDefense;
        }
コード例 #10
0
        public LFireDefenseAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                                 OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.LFIRE_DEFENSE_ALIEN_WORTH, GameInfo.LFIRE_DEFENSE_ALIEN_HEALTH,
                   new Color(255, 213, 139), itemCollected)
        {
            FireDefense = GameInfo.LIGHT_DEFENSE;
            Defense     = GameInfo.LIGHT_DEFENSE;

            AddPotentialDrop(Material.EssenceOfFire, 20);
            AddPotentialDrop(Badge.Orange, 5);

            Type = Aliens.LFireDefense;
        }
コード例 #11
0
        public Alien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height, int worth, int health,
                     Color color, OnItemCollect itemCollected)
        {
            this.itemCollected = itemCollected;

            drawRect = new Rectangle(x, y, width, height);
            eyeRect  = new Rectangle(drawRect.X + (int)(EYE_SPACING * 1.6f), drawRect.Y + EYE_SPACING, SPACING * 8,
                                     SPACING * 2);

            this.y = y;
            eyeY   = eyeRect.Y;

            this.img    = img;
            this.eyeImg = eyeImg;
            Worth       = worth;
            Health      = health;
            origColor   = color;
            Color red = new Color(255, 0, 0);

            color.R      = (byte)((color.R + red.R) / 2.0f);
            color.G      = (byte)((color.G + red.G) / 2.0f);
            color.B      = (byte)((color.B + red.B) / 2.0f);
            hurtColor    = color;
            currentColor = origColor;
            effTimer     = new Timer(2, TimerUnits.Seconds);

            shieldRect   = new Rectangle(0, 0, SHIELD_SIZE, SHIELD_SIZE);
            shieldRect.X = drawRect.Right - shieldRect.Width / 2;
            shieldRect.Y = drawRect.Bottom - shieldRect.Height / 2;

            for (int i = 0; i < worth; i++)
            {
                Coin newC = new Coin(Utilities.CoinImage, 0, 0, COIN_SIZE, COIN_SIZE, 1);
                newC.AddOnCollectHandler(itemCollected);
                Drops.Add(newC);
            }

            eyeMoveTimer = new Timer(200, TimerUnits.Milliseconds);

            healthBar   = new FillBar(health, drawRect.X, 0, drawRect.Width, HEALTHBAR_HEIGHT, health, null);
            healthBar.Y = drawRect.Y - healthBar.Height - SPACING;

            mechImg         = Utilities.MechImg;
            mechRect        = new Rectangle();
            mechRect.Width  = (int)(MECH_RATIO * height);
            mechRect.Height = mechRect.Width;
            mechRect.X      = drawRect.Right - (mechRect.Width / 2);
            mechRect.Y      = drawRect.Bottom - (mechRect.Height / 2);
            mechY           = mechRect.Y;
        }
コード例 #12
0
        public OmegaAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                          OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.OMEGA_ALIEN_WORTH,
                   GameInfo.OMEGA_ALIEN_HEALTH, Color.Gold, itemCollected, ProjectileType.Meteor, 6)
        {
            Defense = GameInfo.OMEGA_DEFENSE;

            AddPotentialDrop(Material.Plasma, 20);
            AddPotentialDrop(Material.PlantMatter, 20);
            AddPotentialDrop(Material.EssenceOfFire, 20);
            AddPotentialDrop(Material.Ice, 20);
            AddPotentialDrop(Material.ChaosEnergy, 10);

            Type = Aliens.Omega;
        }
コード例 #13
0
        public ChaosAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                          OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.CHAOS_ALIEN_WORTH, GameInfo.CHAOS_ALIEN_HEALTH,
                   Color.MediumPurple, itemCollected, ProjectileType.Hex, 5)
        {
            Defense       = GameInfo.HEAVY_DEFENSE;
            FireDefense   = GameInfo.NORMAL_DEFENSE;
            PoisonDefense = GameInfo.NORMAL_DEFENSE;
            PlasmaDefense = GameInfo.LIGHT_DEFENSE;

            for (int i = 0; i < 2; i++)
            {
                AddPotentialDrop(Material.ChaosEnergy, 50);
            }

            Type = Aliens.Chaos;
        }
コード例 #14
0
        public BossAlien(Texture2D img, Texture2D eyeImg, int x, int y, int width, int height,
                         OnItemCollect itemCollected)
            : base(img, eyeImg, x, y, width, height, GameInfo.BOSS_ALIEN_WORTH, GameInfo.BOSS_ALIEN_HEALTH,
                   Color.DarkRed, itemCollected, ProjectileType.Laser, 9)
        {
            speed       = 0.1f;
            canBeFrozen = false;
            Defense     = GameInfo.BOSS_DEFENSE;

            sideToSideTimer = new Timer(20.0f, TimerUnits.Seconds);

            AddPotentialDrop(Material.ChaosEnergy, 75);
            AddPotentialDrop(Material.Metal, 65);
            AddPotentialDrop(Material.Stone, 65);
            AddPotentialDrop(Material.Plasma, 90);
            AddPotentialDrop(Badge.Red, 100);

            Type = Aliens.Boss;
        }
コード例 #15
0
 public void AddOnCollectHandler(OnItemCollect handler)
 {
     onCollect += handler;
 }