tModLoader Creating Dust rings/ovals that rotate while shooting projectiles in all directions

POCKETS

Terrarian
I've been able to create dust rings on my own, and I'm fairly certain I can figure out how to create ovals using this same method, but having them rotate according to where you are shooting is something I haven't been able to figure out yet, so I came here for a bit of help.

Here is an example of how I am creating the dust rings. There might even be a better way to do this (and there may be something I'm overlooking), but this method does work for me -

C#:
for (int i = 0; i < 90; i++) // I could do 360 here, instead of 90 (and then remove the "* 4" from the deg variable), and it still works well
{
    double deg = i * 4;
    double rad = (deg) * (Math.PI / 180);
    double dist = 20;

    float x2 = projectile.Center.X - (int)(Math.Cos(rad) * dist) - projectile.width / 2;
    float y2 = projectile.Center.Y - (int)(Math.Sin(rad) * dist) - projectile.height / 2;

    if (++customCounter % 10 == 0)
    {
        int dust = Dust.NewDust(new Vector2(x2 - projectile.velocity.X, y2 - projectile.velocity.Y), 1, 1, ModContent.DustType<ModDust>(), 0f, 0f, 0, default(Color), 1f);
        Main.dust[dust].noGravity = true;
    }
}

As you can see, this creates dust rings every 10 ticks at the projectile's current location. Again, I can probably figure out how to create an oval by messing with the dist variable (maybe?), but getting the ring to rotate as you rotate your weapon, or as the projectile rotates, is something I haven't been able to accomplish yet.
 
Back
Top Bottom