Shinespark
Skeletron Prime
Not sure I put the code in right:Allright, then we're going to try something completely different... Getting the direction from the rotation.
Try the following:
And see what that gives...Code:Vector2 dir = new Vector2((float)Math.Cos(projectile.rotation), (float)Math.Sin(projectile.rotation)); dir = Vector2.Normalize(dir) * 7;
P.S. This is untested, so there might be a small coding error.. somewhere(?).
Code:
Vector2 pos = projectile.Center;
Vector2 dir = new Vector2((float)Math.Cos(projectile.rotation), (float)Math.Sin(projectile.rotation));
dir = Vector2.Normalize(dir) * 7;
Projectile.NewProjectile(pos.X, pos.Y, dir.X, dir.Y, mod.ProjectileType("PowerBeamShot"), projectile.damage, projectile.knockBack, projectile.owner);
If I did, then I think the problem is the held projectile rotates constantly, probably as a result of this: P.rotation += 0.5f * P.direction;
And so what ends up happening is the direction the projectile shoots in depends on how long it takes the player to release it.