Exemple #1
0
        public void UpdateAssets(Size s)
        {
            lock ( PFSim )
            {
                PFSim.Reapers.Clear();
                PFSim.Reapers.Add(Age.Instance);
                PFSim.Reapers.Add(new Boundary(new Rect(-0.1 * s.Width, -0.1 * s.Height, s.Width * 1.2, s.Height * 1.2)));

                float SW  = ( float )s.Width;
                float SH  = ( float )s.Height;
                float HSW = 0.5f * SW;
                float HSH = 0.5f * SH;

                PFSim.Spawners.Clear();
                PFSim.Spawners.Add(new LinearSpawner(new Vector2(HSW, HSH), new Vector2(HSW, HSH), new Vector2(10, 10))
                {
                    Chaos        = new Vector2(1, 1)
                    , otMin      = 5, otMax = 10
                    , Texture    = tCircle
                    , SpawnTrait = PFTrait.IMMORTAL
                    , SpawnEx    = (P) =>
                    {
                        P.Tint.M11 = ThemeTint.X;
                        P.Tint.M22 = ThemeTint.Y;
                        P.Tint.M33 = ThemeTint.Z;
                        P.Tint.M44 = ThemeTint.W * NTimer.LFloat();

                        P.mf   *= NTimer.LFloat();
                        P.Scale = new Vector2(0.5f, 0.5f) + Vector2.One * (NTimer.LFloat() - 0.25f);
                        P.vt.Y += 5 * NTimer.RFloat();
                    }
                });

                ScrollWind.A       = new Vector2(SW, 0);
                ScrollWind.B       = new Vector2(SW, SH);
                ScrollWind.MaxDist = SW;

                PFSim.Fields.Clear();
                PFSim.AddField(GenericForce.EARTH_GRAVITY);
                PFSim.AddField(ScrollWind);
            }
        }
Exemple #2
0
        public void UpdateAssets(Size s)
        {
            lock ( PFSim )
            {
                PFSim.Reapers.Clear();
                PFSim.Reapers.Add(Age.Instance);
                PFSim.Reapers.Add(new Boundary(new Rect(0, 0, s.Width * 1.2, s.Height * 1.2)));

                float SW  = ( float )s.Width;
                float SH  = ( float )s.Height;
                float HSW = 0.5f * SW;

                PFSim.Spawners.Clear();
                PFSim.Spawners.Add(new Trail()
                {
                    Texture = tGlitter
                });
                PFSim.Spawners.Add(new ExplosionParticle()
                {
                    Texture   = tCircle
                    , SpawnEx = (P) => { P.Scale *= 0.125f; }
                });
                PFSim.Spawners.Add(new LinearSpawner(new Vector2(HSW, SH), new Vector2(0, 0), new Vector2(50, -200))
                {
                    Chaos      = new Vector2(1, 0),
                    SpawnTrait = PFTrait.THRUST | PFTrait.EXPLODE | PFTrait.TRAIL
                    , Texture  = tGlitter
                    , SpawnEx  = (P) => { P.Tint.M44 = 0; }
                });

                PFSim.Fields.Clear();
                PFSim.AddField(GenericForce.EARTH_GRAVITY);
                PFSim.AddField(new Thrust()
                {
                    EndTime = 40f
                });
            }
        }