Пример #1
0
        protected override void LoadContent()
        {
            spriteBatch = new SpriteBatch(GraphicsDevice);

            debugSprite = new Sprite(Content.Load<Texture2D>("JeffCreepyFace"), Vector2.Zero, Color.White);
            debugText = new TextSprite(Content.Load<SpriteFont>("DebugFont"), "Test", new Vector2(100, 100), Color.Purple);
        }
Пример #2
0
        protected override void LoadContent()
        {
            IsMouseVisible = true;
            spriteBatch = new SpriteBatch (GraphicsDevice);

            debugText = new TextSprite(Content.Load<SpriteFont>("DebugFont"), "", Vector2.Zero, Color.White);
            testSprite = new Sprite (Content.Load<Texture2D> ("Square50x50"), new Vector2(GraphicsDevice.Viewport.Width / 2, GraphicsDevice.Viewport.Height / 2), Color.White);

            testSprite.UseCenterOrigin = true;

            engine = new ParticleEngine(
                new Vector2(100, 100), //Engine position
                Vector2.One, //Scale
                Color.White, //Tint
                3, //SpawnCount
                new TimeSpan(0, 0, 0, 0, 1000), //LifeTime
                new TimeSpan(0, 0, 0, 0, 1000),  //SpawnRate
                Content.Load<Texture2D>("circle"),//params Texture2D[]
                Content.Load<Texture2D>("diamond"),
                Content.Load<Texture2D>("star"));

            engine.SpawnCount = 20;

            engine.LifeTime = new TimeSpan(0, 0, 0, 0, 1000);

            engine.SpawnRate = new TimeSpan(0, 0, 0, 0, 1100);

            engine.ParticleSpeed = 4f;

            engine.Scale = new Vector2(1f, 1f);

            engine.RandomColors = true;

            engine.RandomSpeed = true;

            engine.AngleToShoot = 0;

            engine.TargetAlpha = 0;

            engine.TargetRotation = 90;

            engine.TargetScale = new Vector2(2, 2);

            engine.AngleDeviation = 30;

            //engine.LifeTimeDeviation = TimeSpan.FromMilliseconds(1000);

            engine.FollowItem = testSprite;

            engine.UseGravity = true;

            engine.GravityScale = 1f;

            engine.AutoSpawn = true;
        }