Exemplo n.º 1
0
        public ParticleAffector xAddAffector(string type)
        {
            ParticleSystem ps = xGetCurrentSystem();

            if (ps == null)
            {
                return(null);
            }
            return(ps.AddAffector(type));
        }
Exemplo n.º 2
0
        static EntityManager()
        {
            enemies          = new List <Movable>();
            enemiesBuffer    = new List <Movable>();
            heroProjectiles  = new List <HeroProjectile>();
            enemyProjectiles = new List <EnemyProjectile>();
            hero             = Hero.GetInstance();
            system           = new ParticleSystem(Game.ParticleTexture);
            screenTexts      = new List <ScreenText>();

            system.AddAffector(new BounceOffWall());
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="line"></param>
        /// <param name="system"></param>
        private void ParseAffector(string type, TextReader script, ParticleSystem system)
        {
            ParticleAffector affector = system.AddAffector(type);

            string line = "";

            while(line != null) {
                line = ParseHelper.ReadLine(script);

                if(!(line.Length == 0 || line.StartsWith("//"))) {
                    if(line == "}") {
                        // finished with this affector
                        break;
                    }
                    else {
                        ParseAffectorAttrib(line.ToLower(), affector);
                    }
                } // if
            } // while
        }