Ejemplo n.º 1
0
 public Emitter(Vector2 SecPerSpawn, Vector2 SpawnDirection, Vector2 SpawnNoiseAngle,
     Vector2 StartLife, Vector2 StartScale, Vector2 EndScale, Color StartColor1,
     Color StartColor2, Color EndColor1, Color EndColor2, Vector2 StartSpeed,
     Vector2 EndSpeed, int Budget, Vector2 RelPosition, Texture2D ParticleSprite,
     Random random, ParticleSystem parent, float InitialLife)
 {
     this.SecPerSpawn = SecPerSpawn;
     this.SpawnDirection = SpawnDirection;
     this.SpawnNoiseAngle = SpawnNoiseAngle;
     this.StartLife = StartLife;
     this.StartScale = StartScale;
     this.EndScale = EndScale;
     this.StartColor1 = StartColor1;
     this.StartColor2 = StartColor2;
     this.EndColor1 = EndColor1;
     this.EndColor2 = EndColor2;
     this.StartSpeed = StartSpeed;
     this.EndSpeed = EndSpeed;
     this.Budget = Budget;
     this.RelPosition = RelPosition;
     this.ParticleSprite = ParticleSprite;
     this.random = random;
     this.Parent = parent;
     ActiveParticles = new LinkedList<Particle>();
     this.NextSpawnIn = MathLib.LinearInterpolate(SecPerSpawn.X, SecPerSpawn.Y, random.NextDouble());
     this.SecPassed = 0.0f;
     this.InitialLife = InitialLife;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Allows the game to perform any initialization it needs to before starting to run.
 /// This is where it can query for any required services and load any non-graphic
 /// related content.  Calling base.Initialize will enumerate through any components
 /// and initialize them as well.
 /// </summary>
 protected override void Initialize()
 {
     // TODO: Add your initialization logic here
     spriteBatch = new SpriteBatch(this.GraphicsDevice);
     ParticleBase = this.Content.Load<Texture2D>("ParticleBase1");
     Bullet = this.Content.Load<Texture2D>("Bullet");
     Pixel = this.Content.Load<Texture2D>("Pixel");
     particleSystem = new ParticleSystem(new Vector2(0, 0));
     /*particleSystem.AddEmitter(new Vector2(0.01f, 0.015f),
                                 new Vector2(0, -1), new Vector2(0.1f * MathHelper.Pi, 0.1f * -MathHelper.Pi),
                                 new Vector2(0.5f, 0.75f),
                                 new Vector2(60, 70), new Vector2(15, 15f),
                                 Color.Orange, Color.Crimson, Color.Orange, Color.Orange,
                                 new Vector2(400, 500), new Vector2(100, 120), 1000, Vector2.Zero, ParticleBase); */
     font = this.Content.Load<SpriteFont>("SpriteFont1");
     base.Initialize();
 }