コード例 #1
0
ファイル: ParticleManager.cs プロジェクト: joris556/CardGame
        //Strategypattern omg, ziek vet
        public void CreateParticleEffect(EffectType ef, Vector2 pos, int ptCount)
        {
            ParticleEffect pe = new ParticleEffect(2.5f);

            switch (ef)
            {
            case EffectType.GroundSlam:
                for (int i = 0; i < ptCount; i++)
                {
                    pe.Add(new GroundSlamParticle(pos, RandomDir() * (random.Next() % 2 + 3), triangleTex, new Color(227, 198, 118), random));     //0xE8B969
                }
                break;

            case EffectType.GetHit:
                for (int i = 0; i < ptCount; i++)
                {
                    pe.Add(new GroundSlamParticle(pos, RandomDir() * (random.Next() % 2 + 3), triangleTex, new Color(169, 24, 27), random));     //0xE8B969
                }
                break;
            }

            partEffects.Add(pe);
        }