Circular Bullet Spread not Even
- by SoulBeaver
I'm creating a bullet shooter much in the style of Touhou. Right now I want to have a very simple circular shot being fired from the enemy.
See this picture:
As you can see, the spacing is very uneven, which isn't very good if you want to survive.
The code I'm using is this:
private function shoot() : void
{
const BULLETS_PER_WAVE : int = 72;
var interval : Number = BULLETS_PER_WAVE / 360;
for (var i : int = 0; i < BULLETS_PER_WAVE; ++i
{
var xSpeed : Number = GameConstants.BULLET_NORMAL_SPEED_X * Math.sin(i * interval);
var ySpeed : Number = GameConstants.BULLET_NORMAL_SPEED_Y * Math.cos(i * interval);
BulletFactory.createNormalBullet(bulletColor_, alice_.center, xSpeed, ySpeed);
}
canShoot_ = false;
cooldownTimer_.start();
}
I imagine my mistake is in the sin, cos functions, but I'm not entirely sure what's wrong.