Beispiel #1
0
        public ParticleEmitter(Vector2 position, EParticleType type, int emitsPerSecond)
        {
            this.type           = type;
            this.position       = position;
            this.emitsPerSecond = emitsPerSecond;

            this.particles = new List <Particle>();
        }
Beispiel #2
0
        public CParticle(int partyModeID, string textureName, SColorF color, float x, float y, float size, float maxage, float z, float vx, float vy, float vr, float vsize,
                         EParticleType type)
        {
            _PartyModeID = partyModeID;
            _TextureName = textureName;
            _Color       = color;
            _Rect        = new SRectF(x, y, size, size, z);
            _Size        = size;
            _Vx          = vx;
            _Vy          = vy;
            _Vr          = vr;
            _Vsize       = vsize;
            _Type        = type;

            _MaxAge   = maxage;
            _Rotation = (float)(CBase.Game.GetRandomDouble() * 360.0);
        }
Beispiel #3
0
        private void emit(EParticleType type, GameTime gametime)
        {
            switch (type)
            {
            case EParticleType.torchParticle:


                Vector2 target = new Vector2(position.X, position.Y - 128);

                Vector2 positionOffset = new Vector2(position.X + (float)Math.Sin(Math.PI * 4 * Kaibo_Crawler.random.NextDouble()) * 32.0f, position.Y);
                Vector2 direction      = target - positionOffset;
                direction.Normalize();


                float  speed    = 1;
                double lifeTime = 2.0d;


                particles.Add(new Particle(Kaibo_Crawler.particle, positionOffset, direction, speed, lifeTime));


                break;
            }
        }
Beispiel #4
0
 public CParticleEffect(int partyModeID, int maxNumber, SColorF color, SRectF rect, string skin, float size, EParticleType type)
 {
     _PartyModeID     = partyModeID;
     _Theme           = new SThemeParticleEffect();
     _Stars           = new List <CParticle>();
     MaxRect          = rect;
     Color            = color;
     _Theme.Skin      = skin;
     _Theme.MaxNumber = maxNumber;
     _Theme.Size      = size;
     _Theme.Type      = type;
     _SpawnTimer      = new Stopwatch();
     _NextSpawnTime   = 0f;
     Visible          = true;
 }
Beispiel #5
0
 public CParticleEffect GetNewParticleEffect(int maxNumber, SColorF color, SRectF area, CTextureRef texture, float size, EParticleType type)
 {
     return(new CParticleEffect(PartyModeID, maxNumber, color, area, texture, size, type));
 }