public override void Update() { _tickCounter += GoodRnd.NextBin(); if (_tickCounter % 2 == 0 && _target.alive) { GameScene.Instance.Add(new Particle(X, Y, Assets.ParticleStar, 4, 4) { LifeSpan = 10, Angle = 10, FinalAlpha = 0, FinalX = X + GoodRnd.gen.Next(-20, 20) * (float)GoodRnd.gen.NextDouble(), FinalY = Y + GoodRnd.gen.Next(-20, 20) * (float)GoodRnd.gen.NextDouble(), FinalScaleX = 0.5f, LockScaleRatio = true }); } base.Update(); }
public void spawnCreeps() { switch (_creepCount) { case 0: GameScene.Instance.Add(new Melee(_team, new Point((int)(X - 20 * GoodRnd.NextFloatBin()), (int)(Y + (int)_team * 10)))); _creepCount++; break; case 1: GameScene.Instance.Add(new Melee(_team, new Point((int)(X + 20 * GoodRnd.NextFloatBin()), (int)(Y + (int)_team * 10)))); _creepCount++; break; case 2: GameScene.Instance.Add(new Ranged(_team, new Point((int)(X), (int)(Y - (int)_team * 10)))); _creepCount++; break; case 3: if (_siegeCD <= 0) { GameScene.Instance.Add(new Siege(_team, new Point((int)(X + (int)_team * 20), (int)(Y - (int)_team * 20)))); _siegeCD = 3 * _creepsCooldown; } _creepCount++; break; case 4: GameScene.Instance.Add(new Melee(_team, new Point((int)(X), (int)(Y)))); _creepCount++; break; default: _creepsCD = _creepsCooldown; _creepCount = 0; break; } }