コード例 #1
0
        /// <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();
            }
        }
コード例 #2
0
ファイル: Level.cs プロジェクト: jdoiron94/Outside-The-Box
 /// <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();
     }
 }
コード例 #3
0
 /// <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()));
 }