示例#1
0
        public override void update(GameTime gameTime)
        {
            acum++;
            if(acum > timerCount)
            {
                for (int i = 0; i <= quantity; i++)
                {

                    StaticObject temp = new StaticObject(particlePath);
                    temp.init(content);

                    temp.velocity = new Vector2((float)(rnd.NextDouble() - 0.5d), (float)rnd.NextDouble());
                    temp.position = position;
                    temp.timeToDestruct = 40;
                    vecParticles.AddLast(temp);
                }
                acum = 0;
            }
            for (int i = 0; i < vecParticles.Count; i++)
            {
                vecParticles.ElementAt(i).update(gameTime);
                if (vecParticles.ElementAt(i).dead)
                    vecParticles.Remove(vecParticles.ElementAt(i));
            }
            base.update(gameTime);
        }
 /**
 * Adiciona uma entidade na camada
 */
 public void add(StaticObject entity)
 {
     objList.AddLast(entity);
 }