Ejemplo n.º 1
0
 public Cow(CowManager manager, WallManager wallManager, CowStack cowStack, Texture2D h1Texture, Texture2D h2Texture, int health)
 {
     cowPosition = new Vector2(0, floorLevel);
     this.manager = manager;
     this.wallManager = wallManager;
     isDead = false;
     partOfPyramid = false;
     this.cowStack = cowStack;
     this.health = health;
     healthBar = new HealthBar(h1Texture, h2Texture, cowPosition, health);
 }
 public NewTowerStoreItem(WallManager wallManager)
     : base(15)
 {
     this.wallManager = wallManager;
 }
Ejemplo n.º 3
0
 public Bull(CowManager manager, WallManager wallManager, CowStack cowStack, Texture2D h1Texture, Texture2D h2Texture)
     : base(manager, wallManager, cowStack, h1Texture, h2Texture, health)
 {
 }
Ejemplo n.º 4
0
 public void SetWallManager(WallManager wallManager)
 {
     this.wallManager = wallManager;
     cowStack = new CowStack(wallManager);
 }
Ejemplo n.º 5
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create cow manager
            cowManager = new CowManager(collisionManager, Content.Load<Texture2D>("art//healthBar1"), Content.Load<Texture2D>("art//healthBar2"));
            // Create a new SpriteBatch, which can be used to draw textures.
            spriteBatch = new SpriteBatch(GraphicsDevice);
            background = Content.Load<Texture2D>("art//bg");
            Texture2D wallTexture = Content.Load<Texture2D>("art//Wall_Block");

            font = Content.Load<SpriteFont>("ScoreFont");
            meatStore = new MeatStore(font, Content.Load<Texture2D>("art//storebackground"));

            cowManager.AddTexture(typeof(KamikazeCow), Content.Load<Texture2D>("art//Cow_Piece_kamikaze_cow"));
            cowTexture = Content.Load<Texture2D>("art//Cow_Piece");
            cowManager.AddTexture(typeof(Cow), cowTexture);
            cowManager.AddTexture(typeof(Bull), Content.Load<Texture2D>("art//Cow_Piece_bull"));
            cowManager.AddTexture(typeof(Meat), Content.Load<Texture2D>("art//meat"));

            catapult = new Catapult(Content.Load<Texture2D>("art//catapult"), Content.Load<Texture2D>("art//line"), Content.Load<Texture2D>("art//ammo"), collisionManager);
            wallManager = new WallManager(wallTexture);
            cowManager.SetWallManager(wallManager);
            Texture2D villagerTexture = Content.Load<Texture2D>("art//villager");
            villagerManager = new VillagerManager(villagerTexture, cowManager, collisionManager, meatStore);

            meatStore.addTexture(typeof(NewTowerStoreItem), wallTexture);
            meatStore.addTexture(typeof(NewVillagerStoreItem), villagerTexture);
            meatStore.addTexture(typeof(DamageUpgrade), Content.Load<Texture2D>("art//DamageUpgrade"));
            NewTowerStoreItem towerStoreItem = new NewTowerStoreItem(wallManager);
            NewVillagerStoreItem villagerItem = new NewVillagerStoreItem(villagerManager);
            DamageUpgrade damageUpgrade = new DamageUpgrade(catapult);
            //NewTowerStoreItem towerItem2 = new NewTowerStoreItem(wallManager);
            meatStore.addStoreItem(towerStoreItem);
            meatStore.addStoreItem(villagerItem);
            meatStore.addStoreItem(damageUpgrade);
            // TODO: use this.Content to load your game content here
        }
Ejemplo n.º 6
0
 public CowStack(WallManager wallManager)
 {
     Stack = new Cow[12, 11];
     this.wallManager = wallManager;
 }