Decimation_Mod/Lib/Util/DustUtils.cs
2020-07-06 20:53:39 -04:00

19 lines
721 B
C#

using System;
using Microsoft.Xna.Framework;
using Terraria;
namespace Decimation.Lib.Util
{
public class DustUtils
{
public static void NewDustCircle(int amount, Vector2 position, int width, int height, int type, float scale = 1f, float speedX = 1f, float speedY = 1f, bool gravity = false, int alpha = 0, Color color = default)
{
for (int i = 0; i < amount; i++)
{
Vector2 velocity = new Vector2(speedX, speedY).RotatedBy(Math.PI * (2f / amount * i));
int dust = Dust.NewDust(position, width, height, type, velocity.X, velocity.Y, alpha, color, scale);
Main.dust[dust].noGravity = !gravity;
}
}
}
}