Ejemplo n.º 1
0
        public Ammunition(Catapult catapult, Vector2 startVelocity, Vector2 startPosition, Texture2D texture, int damage)
        {
            this.catapult = catapult;
            this.texture = texture;
            velocity = startVelocity;
            velocity.X = MathHelper.Clamp(velocity.X, 1.5f, 100f);
            position = startPosition;
            this.damage = damage;
            timeTillDeath = -10f;
            isDead = false;
            flying = true;

            angle = (float)Math.Atan2(startVelocity.Y, startVelocity.X);
        }
 public DamageUpgrade(Catapult catapult)
     : base(30)
 {
     this.catapult = catapult;
 }
Ejemplo n.º 3
0
 public Amunition(Catapult catapult, Vector2 startVelocity, Vector2 startPosition)
 {
     this.catapult = catapult;
     velocity = startVelocity;
     position = startPosition;
 }
Ejemplo n.º 4
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
        }