public virtual void ResetParticle(PRTC particle) // обновление поля частиц { particle.Life = PRTC.rand.Next(LifeMIN, LifeMAX); particle.X = X; particle.Y = Y; var tp = TPP + (double)PRTC.rand.Next(RAZ) - RAZ / 2; var speed = PRTC.rand.Next(SMIN, SMAX); particle.SX = (float)(Math.Cos(tp / 180 * Math.PI) * speed); particle.SY = -(float)(Math.Sin(tp / 180 * Math.PI) * speed); particle.Rad = PRTC.rand.Next(RadMIN, RadMAX); }
public void ImpactParticle(PRTC particle) // "сердце" нашего телепорта (отправка партиклов) { float gX = X - particle.X; float gY = Y - particle.Y; double r = Math.Sqrt(gX * gX + gY * gY); if (r + particle.Rad < Rad / 2) { particle.X = OX + -gX; particle.Y = OY + -gY; particle.SX = (float)(Math.Cos(OTP / 180 * Math.PI) * OS); particle.SY = -(float)(Math.Sin(OTP / 180 * Math.PI) * OS); } }