Example #1
0
		protected override void Initialize() {
			if (mWorld == null) {
				mWorld = new DefenderWorld(this);
				Components.Add(mWorld);
			}

			base.Initialize();
			LoadContent();
		}
Example #2
0
        public DefenderWorld(DefenderGame game)
            : base(game)
        {
            mInstance = this;

            mWaves      = new UnitWaveList();
            mSpawnTimer = mSpawnInterval;

            Initialize();
        }
Example #3
0
        protected override void Initialize()
        {
            if (mWorld == null)
            {
                mWorld = new DefenderWorld(this);
                Components.Add(mWorld);
            }

            base.Initialize();
            LoadContent();
        }
Example #4
0
		public Bullet( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision )
			: base( world, position, target, dmg, speed, imprecision ) {
			texProjectile = world.texBullet;
			mMissAnimation = "dirt puff";
			mHitAnimation = "red puff";

			mAdditive = true;
			mScale = 0.4f;
			mDmgType = EUnitDamageType.Pierce;

			mColor = new Color( 255, 150, 150, 255 );

			CalculateMovement();
			SetupProjectile();
		}
Example #5
0
        public virtual void Update(GameTime gameTime, DefenderWorld world)
        {
            if (world.StartWaves == false)              // not yet started
            {
                return;
            }

            MoneyTime += (float)gameTime.ElapsedGameTime.TotalMilliseconds;
            if (MoneyTime < 3000)
            {
                return;
            }
            MoneyTime -= 3000;
            Money     += 1;
        }
Example #6
0
		public Concussion( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision, int netSize, float slowEffect, int duration )
			: base( world, position, target, dmg, speed, imprecision ) {
			texProjectile = world.texConcussion;
			mMissAnimation = "concussion";
			mHitAnimation = "concussion";
			mSplash = true;

			mDmgType = EUnitDamageType.Energy;

			mNetSize = netSize;
			mSlowEffect = slowEffect;
			mDuration = duration;

			CalculateMovement();
			SetupProjectile();
		}
Example #7
0
		public Pulse( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision )
			: base( world, position, target, dmg, speed, imprecision ) {
			texProjectile = world.texBullet;
			mMissAnimation = "redCircle";
			mHitAnimation = "pulseHit";

			mDmgType = EUnitDamageType.Energy;
			mAcceleration = 0;
			mAdditive = true;
			mScale = 0.7f;

			mColor = new Color( 255, 60, 60, 255 );

			CalculateMovement();
			SetupProjectile();
		}
Example #8
0
		public Flame( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision, int sDmg, int sRange, float acceleration )
			: base( world, position, target, dmg, speed, imprecision ) {
			texProjectile = world.texFire;
			mHitAnimation = "explosion3";
			mMissAnimation = mHitAnimation;

			mDmgType = EUnitDamageType.Burn;

			mSplash = true;
			mSplashDmg = sDmg;
			mSplashRange = sRange;
			mAcceleration = acceleration;

			SetupProjectile();
			CalculateMovement();
		}
Example #9
0
		public Shell( DefenderWorld world, Vector2 position, Unit target, int dmg, float speed, int imprecision, int sDmg, int sRange, float acceleration, bool homing )
			: base( world, position, target, dmg, speed, imprecision ) {
			texProjectile = world.texRocket;

			mHitAnimation = "explosion1";
			mHitSound = "RndExplosion";
			mMissAnimation = mHitAnimation;

			mDmgType = EUnitDamageType.Explosive;
			mMaxSpeed = 15;
			mSplash = true;

			mSplashDmg = sDmg;
			mSplashRange = sRange;
			mHoming = homing;
			mAcceleration = acceleration;

			SetupProjectile();
			CalculateMovement();
		}
Example #10
0
		public virtual void Update( GameTime gameTime, DefenderWorld world ) {
			if( world.StartWaves == false ) // not yet started
				return;

			MoneyTime += (float)gameTime.ElapsedGameTime.TotalMilliseconds;
			if( MoneyTime < 3000 )
				return;
			MoneyTime -= 3000;
			Money += 1;
		}
Example #11
0
 public virtual void Restart()
 {
     // TODO: fix me
     mWorld = new DefenderWorld(this);
 }
Example #12
0
		public DefenderWorld(DefenderGame game)
			: base(game) {
			mInstance = this;

			mWaves = new UnitWaveList();
			mSpawnTimer = mSpawnInterval;

			Initialize();
		}
Example #13
0
		public virtual void Restart() {
			// TODO: fix me
			mWorld = new DefenderWorld(this);
		}