I’m trying to make Angry Birds in unity, and I got everything else working as intended, including the birds: Red,
Hal, Chuck, Blues and Terence. But 1 bird has been stumping me, Silver, from Angry Birds 2. For those who don’t know, Silver has increased power to stone, with the ability to loop-de-loop then crash down, slightly popping nearby blocks and pigs into the air. The “pop into the air” part is not my main concern, how in the heck am I supposed to do a full on loop-de-loop!? I have tried countless things and failed.
So far my code for when Silver’s power is activated looks something like this:
if (P)
{
if (//Hal's power script)
else if (B == 4)
{
if (idk == 0 && !(transform.position.y < cm.y))
{
idk = 1;
}
else if (transform.position.y < cm.y && idk == 0)
{
ca += -1 * Time.deltaTime;
Vector2 offset = new Vector2(Mathf.Sin(ca), Mathf.Cos(ca));
transform.position = cm + offset;
}
if(idk == 1 && !(transform.position.y > cm.y))
{
idk = 2;
}
else if (transform.position.y > cm.y && idk == 1)
{
ca += -1 * Time.deltaTime;
Vector2 offset = new Vector2(Mathf.Sin(ca), Mathf.Cos(ca));
transform.position = cm + offset;
}
if (idk == 2)
{
P = false;
rb.velocity = Vector2.down * 10;
}
}
}
cm is the center movement pont determined right when the power is activated. Also this is all in void Update(). Any and all help on this (and maybe on any other bird I didn’t mention at the start) would be greatly appreciated!