Example #1
0
    void CreateDieExplosion()
    {
        Random  rng      = new Random();
        Vector2 position = TKMath.GetAngleVector((float)rng.NextDouble() * 360f) * ((float)rng.NextDouble() * size.X * 0.5f);

        EffectExplosion.CreateExplosion(Position + position, 0.8f, Map);
    }
Example #2
0
    public override void Logic()
    {
        if (!IsAlive)
        {
            if (!dieTimer.IsDone)
            {
                dieTimer.Logic();
                dieExplosionTimer.Logic();

                if (dieExplosionTimer.IsDone)
                {
                    CreateDieExplosion();
                    dieExplosionTimer.Reset();
                }

                if (dieTimer.IsDone)
                {
                    EffectExplosion.CreateExplosion(Position, 5f, Map);
                }
            }

            return;
        }

        healthBar.Progress = health / MaxHealth;
        healthBar.Logic();
    }
Example #3
0
	public override void Die(Vector2 diePos)
	{
		base.Die(diePos);
		EffectExplosion.CreateExplosion(diePos, 0.7f, Map);

		Map.RemoveCreep(this);
	}
Example #4
0
    public void ReceiveDie()
    {
        EffectExplosion.CreateExplosion(Position, 1.8f, Map);
        if (point != null)
        {
            point.Reset();
        }

        Map.TowerDestroyed(this);

        health = 0;
    }