Example #1
0
 public Banjo(int x, int y)
 {
     this.type = BanjoType.Standard;
     Init(x, y);
     this.yVel = ACWGame.HEIGHT / 4;
     ai = new StandardBanjoAI();
 }
Example #2
0
        public Banjo()
        {
            // random values
            int randX   = rand.Next(1, 4);
            int randY   = rand.Next(50, 100);
            int randVal = rand.Next(0, 100);

            // randomly set position between 3 points on screen
            if (randX < 2)
            {
                position.X = MainGame.self.Window.ClientBounds.Width / 4;
            }
            else if (randX < 3)
            {
                position.X = MainGame.self.Window.ClientBounds.Width / 2;
            }
            else
            {
                position.X = MainGame.self.Window.ClientBounds.Width - MainGame.self.Window.ClientBounds.Width / 4;
            }

            position.Y = randY;
            width      = 30;
            height     = 80;
            speed      = 100;
            SetHealth(1);

            // randomly create different banjo types
            if (randVal < 75)
            {
                banjoType = BanjoType.plainBanjo;
            }
            else if (randVal < 90)
            {
                banjoType = BanjoType.hunterBanjo;
            }
            else
            {
                banjoType = BanjoType.deadlyBanjo;
            }

            if (banjoType == BanjoType.deadlyBanjo)
            {
                speed = 120;
                SetHealth(2);
            }
        }
Example #3
0
 public override void LoadFromData(string[] loadData)
 {
     position.X = float.Parse(loadData[1]);
     position.Y = float.Parse(loadData[2]);
     velocity.X = float.Parse(loadData[3]);
     velocity.Y = float.Parse(loadData[4]);
     SetHealth(int.Parse(loadData[5]));
     shootTimer = float.Parse(loadData[6]);
     spawnDelay = float.Parse(loadData[7]);
     if (loadData[8] == "deadlyBanjo")
     {
         banjoType = BanjoType.deadlyBanjo;
     }
     else if (loadData[8] == "hunterBanjo")
     {
         banjoType = BanjoType.hunterBanjo;
     }
     else
     {
         banjoType = BanjoType.plainBanjo;
     }
 }
        public Banjo(int identityNo, ActionBox box, BanjoType type, Texture2D[] textures, Color[][] textureColorData, Explosion[] explosions, Random explosionPointGen, SoundEffect explodeSound, Vector2 location, float layerPoint, int ageInMilliseconds = 0)
        {
            ID   = identityNo;
            Type = type;
            if (Type == BanjoType.Normal)
            {
                Texture          = textures[0];
                TextureColorData = textureColorData[0];
                Velocity         = 1;
                HitPoints        = 1;
                ScoreValue       = 10;
            }
            else if (Type == BanjoType.Hunter)
            {
                Texture          = textures[1];
                TextureColorData = textureColorData[1];
                Velocity         = 1;
                HitPoints        = 1;
                ScoreValue       = 20;
            }
            else
            {
                Texture          = textures[2];
                TextureColorData = textureColorData[2];
                Velocity         = 3;
                HitPoints        = 2;
                ScoreValue       = 50;
            }

            Location          = location;
            Box               = new ActionBox(box.PixelTexture, box.Color, (int)Location.X, (int)Location.Y, (int)(Texture.Width * _scale), (int)(Texture.Height * _scale));
            LayerPoint        = layerPoint;
            AgeInMilliseconds = ageInMilliseconds;
            _random           = explosionPointGen;
            base.SetupExplosions(explosions, explosionPointGen, explodeSound);
        }
Example #5
0
 public Banjo(int x, int y, Accordian player, BanjoType type, GameState state = null)
 {
     Init(x, y);
     Init(type, player, state);
 }
Example #6
0
 public Banjo(Accordian player, BanjoType type)
 {
     Init(0, 0);
     Init(type, player);
 }
Example #7
0
 public void Init(BanjoType type, Accordian player, GameState state = null)
 {
     if (type == BanjoType.Standard)
     {
         this.yVel = ACWGame.HEIGHT / 3;
         ai = new StandardBanjoAI();
     }
     else if (type == BanjoType.Hunter)
     {
         this.ai = new HunterBanjoAI(player);
     }
     else if (type == BanjoType.DeadlyStrummer)
     {
         this.hp = 2;
         this.xVel = ACWGame.WIDTH / 2.8;
         this.yVel = ACWGame.HEIGHT / 4;
         this.ai = new DeadlyStrummerAI(player, state);
     }
     this.state = state;
     this.type = type;
 }