public override void RotationFire(Vector2 spawnLocation, float playerRotation, float speed) { Vector2 target = new Vector2((float)Math.Cos(playerRotation), (float)Math.Sin(playerRotation)); Projectiles.Shot s = (Projectiles.Shot)pool.SpawnFromPool(spawnLocation, target); s.Speed = speed; s.damage = HandGunDamge; }
void WaveSpread(Vector2 spawnLocation, float playerRotation, float speed) { for (int i = (int)-(.5 * numberOfBullets); i < (.5 * numberOfBullets); i++) { Vector2 target = new Vector2((float)Math.Cos(playerRotation + (bulletOffset * i)), (float)Math.Sin(playerRotation + (bulletOffset * i))); Projectiles.Shot s = (Projectiles.Shot)pool.SpawnFromPool(spawnLocation, target); s.Speed = speed; s.damage = WaveGunDamage; } }
public override void RotationFire(Vector2 spawnLocation, float playerRotation, float speed) { float offset; if (r.Next(0, 2) == 1) { offset = (float)r.NextDouble(); } else { offset = -(float)r.NextDouble(); } Vector2 target = new Vector2((float)Math.Cos(playerRotation + (offset * spreadModifier)), (float)Math.Sin(playerRotation + (offset * spreadModifier))); Projectiles.Shot s = (Projectiles.Shot)pool.SpawnFromPool(spawnLocation, target); s.Speed = speed; s.damage = RifleDamge; }