Getting an error while trying to add a projectile attack to my boss
Error: c:\Users\Hailey\Documents\My Games\Terraria\ModLoader\Mod Sources\SaobiesMod\NPCs\Boss\MindBreaker.cs(47,14) : error CS0270: Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
Code (line 47 and below):
npc.ai [1]++;
if (npc.ai[1] >= 230)
{
float Speed = 20f
Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc/height / 2));
int damage = 14;
int type = mod.ProjectileType("BreakerBolt");
Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17);
float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f)));
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)((Math.Cos(rotation) = Speed) * -1), (float)((Math.Sin(rotation) = Speed) = -1), type, damage, 0f, 0);
npc.ai[1] = 0;
}
-----------------------
Kindly PM me any details that may help fix this, or PM me if more details pertaining to the issue are needed
Error: c:\Users\Hailey\Documents\My Games\Terraria\ModLoader\Mod Sources\SaobiesMod\NPCs\Boss\MindBreaker.cs(47,14) : error CS0270: Array size cannot be specified in a variable declaration (try initializing with a 'new' expression)
Code (line 47 and below):
npc.ai [1]++;
if (npc.ai[1] >= 230)
{
float Speed = 20f
Vector2 vector8 = new Vector2(npc.position.X + (npc.width / 2), npc.position.Y + (npc/height / 2));
int damage = 14;
int type = mod.ProjectileType("BreakerBolt");
Main.PlaySound(23, (int)npc.position.X, (int)npc.position.Y, 17);
float rotation = (float)Math.Atan2(vector8.Y - (P.position.Y + (P.height * 0.5f)), vector8.X - (P.position.X + (P.width * 0.5f)));
int num54 = Projectile.NewProjectile(vector8.X, vector8.Y, (float)((Math.Cos(rotation) = Speed) * -1), (float)((Math.Sin(rotation) = Speed) = -1), type, damage, 0f, 0);
npc.ai[1] = 0;
}
-----------------------
Kindly PM me any details that may help fix this, or PM me if more details pertaining to the issue are needed