# Resource Dancing Squid

Discussion in 'Spigot Plugin Development' started by Proximyst, Jun 19, 2016.

1. ### Proximyst

So. I was attempting to create an animation in Minecraft of circular sectors..
and I have to say: I am the only one I know who managed to create a dancing squid instead of a circular sector.

Code (Java):
for (int i = 0; i < 90; i++)
{
if (t < 2 * Math.PI) t += 0.39 / 2;
else t = 0;
if (t1 < 2 * Math.PI) t1 += 0.39 / 2;
else t1 = 0;
double x1 = Math.cos((t * Math.PI) / 6) * 3;
double x2 = Math.cos((t == 0 ? 6 : t - 0.39 / 2) * Math.PI) / 6 * 3;
double z1 = Math.sin((t * Math.PI) / 6) * 3;
double z2 = Math.sin((t == 0 ? 6 : t - 0.39 / 2) * Math.PI) / 6 * 3;
Location sektor1 = location.clone().add(x1, 0, z2);
Location sektor2 = location.clone().subtract(x2, 0, z1);
sektor1.getWorld().playEffect(sektor1, Effect.NOTE, 0);
sektor2.getWorld().playEffect(sektor2, Effect.NOTE, 1);
}

t and t1 are doubles set as 0.
location is the player location.

Have fun <3
Hopefully someone'll make a squid minigame.

• Funny x 1
• Winner x 1
2. ### Choco Moderator

When math goes wrong Gotta admit, that looks pretty cool though

Ikr :3