public Enemy(Vector2 position) : base(position) { IsAlive = true; followBear = null; Scale = 1; mScale = new Vector2(Scale, Scale); CurrentState = State.Aimless; mFollowPlayerAI = new FollowPlayerAI(this, followBear); mAfraidAI = new AfraidAI(this); mPlantingAI = new PlantingAI(this); mEvilAI = new EvilAI(this); SeedPouch pouch = new SeedPouch(1); mGetSeedAI = new GetSeedAI(this, pouch); mPlantSeedAI = new PlantSeedAI(this, pouch); bCurrGetSeed = true; mCommands = new List<AIComponent>(); mNumCommands = 0; mNextCommandIndex = 0; mCurrCommand = null; AddCommand(mGetSeedAI); AddCommand(mPlantSeedAI); Pouch = new SeedPouch(2); bListening = false; }
public Projectile(Vector2 position, float speed, Vector2 direction, PolarBear.Power type, PolarBear shooter) : base(position) { Position = position; Velocity = new Vector2(speed); Direction = Vector2.Normalize(direction); Type = type; IsAlive = true; Shooter = shooter; }
public void LoadContent() { LoadLevel("levelforest"); UpdateKeeper.getInstance().updateAll(new GameTime()); AGrid.GetInstance().setLevel(UpdateKeeper.getInstance().getLevelElements()); polarBear = new PolarBear(new Vector2(-1950, 1800)); ScreenManager.camera.FocusEntity = polarBear; forestBoss = new Boss(new Vector2(0, -1500)); forestBoss.LoadContent(); polarBear.LoadContent(); UpdateKeeper.getInstance().addEntity(polarBear); DrawKeeper.getInstance().addEntity(polarBear); UpdateKeeper.getInstance().addEntity(forestBoss); DrawKeeper.getInstance().addEntity(forestBoss); Enemy ene; for (int i = 0; i < maxEnemies; i++) { ene = new Enemy(new Vector2(random.Next(350, 400), random.Next(350, 400))); ene.Velocity = new Vector2(random.Next(1, 10), random.Next(1, 10)); ene.CurrentState = Enemy.State.Evil; ene.LoadContent(); UpdateKeeper.getInstance().addEntity(ene); DrawKeeper.getInstance().addEntity(ene); } for (int i = 0; i < bossMinions; i++) { ene = new Enemy(new Vector2(random.Next(-200, 200), random.Next(-1500, -1000))); ene.Velocity = new Vector2(0, 0); ene.CurrentState = Enemy.State.Evil; ene.LoadContent(); UpdateKeeper.getInstance().addEntity(ene); DrawKeeper.getInstance().addEntity(ene); } Animal tiger = new Animal(new Vector2(-1750, 1300), Animal.Types.Tiger, Animal.Genders.Male); tiger.LoadContent(); UpdateKeeper.getInstance().addEntity(tiger); DrawKeeper.getInstance().addEntity(tiger); tiger = new Animal(new Vector2(1700, 300), Animal.Types.Tiger, Animal.Genders.Female); tiger.LoadContent(); UpdateKeeper.getInstance().addEntity(tiger); DrawKeeper.getInstance().addEntity(tiger); Animal lion = new Animal(new Vector2(1900, 1900), Animal.Types.Lion, Animal.Genders.Male); lion.LoadContent(); UpdateKeeper.getInstance().addEntity(lion); DrawKeeper.getInstance().addEntity(lion); lion = new Animal(new Vector2(-1300, -1650), Animal.Types.Lion, Animal.Genders.Female); lion.LoadContent(); UpdateKeeper.getInstance().addEntity(lion); DrawKeeper.getInstance().addEntity(lion); Animal panther = new Animal(new Vector2(-550, 1350), Animal.Types.Panther, Animal.Genders.Male); panther.LoadContent(); UpdateKeeper.getInstance().addEntity(panther); DrawKeeper.getInstance().addEntity(panther); panther = new Animal(new Vector2(1900, -1900), Animal.Types.Panther, Animal.Genders.Female); panther.LoadContent(); UpdateKeeper.getInstance().addEntity(panther); DrawKeeper.getInstance().addEntity(panther); }