public static void Display(Vector2 position, int numEffects = 10) { float currentAngle = 0f; float angleStep = 360f / numEffects; lock (_defaultTweens) for (int i = 0; i < numEffects; i++, currentAngle += angleStep) { Instance.Run(position, x => { x.Sprite.TextureColor = new Color(20, 20, 20); var cmd = x.TweenCommands[1]; var driftScale = CDGMath.AngleToVector(currentAngle); cmd.Properties[1] = ((driftScale.X + CDGMath.RandomInt(-5, 5)) * CDGMath.RandomInt(20, 25)).ToString(); cmd.Properties[3] = ((driftScale.Y + CDGMath.RandomInt(-5, 5)) * CDGMath.RandomInt(20, 25)).ToString(); cmd.Properties[5] = CDGMath.RandomInt(-180, 180).ToString(); }); } }
public static void Display(Vector2 position) { float angle = 0f; float angleStep = 24f; lock (_defaultCommands) for (int i = 0; i < 15; i++, angle += angleStep) { Instance.Run(position, x => { int drift = CDGMath.RandomInt(50, 200); Vector2 angleFactor = CDGMath.AngleToVector(angle); var cmd = _defaultCommands[0]; cmd.Properties[1] = (angleFactor.X * drift).ToString(); cmd.Properties[3] = (angleFactor.Y * drift).ToString(); cmd = _defaultCommands[1]; cmd.Properties[1] = CDGMath.RandomFloat(0.5f, 1.1f).ToString(); }); } }