protected override void Initialize() { if (mWorld == null) { mWorld = new DefenderWorld(this); Components.Add(mWorld); } base.Initialize(); LoadContent(); }
public DefenderWorld(DefenderGame game) : base(game) { mInstance = this; mWaves = new UnitWaveList(); mSpawnTimer = mSpawnInterval; Initialize(); }
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(); }
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; }
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(); }
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(); }
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(); }
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(); }
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; }
public virtual void Restart() { // TODO: fix me mWorld = new DefenderWorld(this); }