Chaosy
Tutorial Reviewer
- Joined
- Jun 9, 2011
- Messages
- 13,239
Decided to work directly with radians instead of converting to degrees.
My intention is to form a circle of dummies but the circle does not get completed. The tenth dummy is always missing.
I tried changing the loop to while(i < num + 6) but the tenth dummy still didn't appear, so it's a math problem with the angle, I assume.
My intention is to form a circle of dummies but the circle does not get completed. The tenth dummy is always missing.
I tried changing the loop to while(i < num + 6) but the tenth dummy still didn't appear, so it's a math problem with the angle, I assume.

JASS:
//! zinc
library PrisonAbility requires Table, Missile
{
public struct PrisonCore
{
Table t;
real x, y;
method DummyCircle(integer num, real height)
{
real interval = (bj_PI*2)/num;
real angle;
real nx;
real ny;
integer i = 0;
Missile m;
while(i < num)
{
angle = i*interval;
nx = this.x + 250 * Cos(angle);
ny = this.y + 250 * Sin(angle);
m = Missile.create(nx, ny, height, 0, 0, height);
m.model = "Abilities\\Weapons\\FireBallMissile\\FireBallMissile.mdl";
i += 1;
}
}
static method create(real x, real y) -> thistype
{
thistype this = thistype.allocate();
this.x = x;
this.y = y;
this.DummyCircle(10, 50);
return this;
}
}
}
//! endzinc