/// <summary> /// Adds a new projectile to the level's list of active projectiles /// </summary> /// <param name="projectile">The projectile to add to the projectile list</param> public void addProjectile(Projectile projectile) { projectiles.Add(projectile); SoundEffect effect = projectile.getSound(); if (effect != null) { effect.Play(); } }
/// <summary> /// Adds a new projectile to the level's list of active projectiles /// </summary> /// <param name="projectile">The projectile to add to the projectile list</param> public void addProjectile(Projectile projectile) { projectiles.Add(projectile); SoundEffect effect = projectile.getSound(); if (effect != null) { effect.Play(); } }
/// <summary> /// Returns a new projectile for the game object /// </summary> /// <param name="lastFired">The last time the game object fired a projectile</param> /// <returns>Returns a projectile with a new memory address for the game object</returns> public Projectile createProjectile(double lastFired) { this.lastFired = lastFired; return(new Projectile(projectile.getOwner(), projectile.getTexture(), projectile.getVelocity(), projectile.getCooldown(), projectile.getRotationSpeed(), projectile.getSound())); }