public void fire(GameTime gameTime, ProjectileManager projectileManager, Vector2 postition, bool isplayer, Ship ship) { if (gameTime.TotalGameTime - this.PreviousFireTime > FireTime) { float projectileSpeed; if (isplayer) projectileSpeed = ProjectileSpeed; else projectileSpeed = -ProjectileSpeed; Projectile myProjectile = new Projectile(ProjectileTexture, ProjectileType, projectileSpeed, ProjectileDamage, postition, ship, !isplayer); myProjectile.Position.X += OffsetX; myProjectile.Position.Y += OffsetY; this.PreviousFireTime = gameTime.TotalGameTime; projectileManager.AddProjectile(myProjectile); fired++; } }
public void AddProjectile(Projectile projectile) { Projectiles.Add(projectile); }