1 | using System; |
---|
2 | using System.Collections.Generic; |
---|
3 | using System.Linq; |
---|
4 | using Microsoft.Xna.Framework; |
---|
5 | using Microsoft.Xna.Framework.Audio; |
---|
6 | using Microsoft.Xna.Framework.Content; |
---|
7 | using Microsoft.Xna.Framework.GamerServices; |
---|
8 | using Microsoft.Xna.Framework.Graphics; |
---|
9 | using Microsoft.Xna.Framework.Input; |
---|
10 | using Microsoft.Xna.Framework.Media; |
---|
11 | using Microsoft.Xna.Framework.Net; |
---|
12 | using Microsoft.Xna.Framework.Storage; |
---|
13 | |
---|
14 | namespace Effects |
---|
15 | { |
---|
16 | public abstract class ParticleSystem : DrawableGameComponent |
---|
17 | { |
---|
18 | private Game game; |
---|
19 | |
---|
20 | private Particle[] particles; |
---|
21 | |
---|
22 | #region Subclass variables |
---|
23 | protected Vector2 position; |
---|
24 | |
---|
25 | protected Texture2D texture; |
---|
26 | |
---|
27 | protected Texture2D innerTexture; |
---|
28 | protected Texture2D outTexture; |
---|
29 | |
---|
30 | protected float minScale; |
---|
31 | protected float maxScale; |
---|
32 | |
---|
33 | protected float rotation; |
---|
34 | |
---|
35 | protected Vector2 origin; |
---|
36 | |
---|
37 | protected Vector2 minVelocity; |
---|
38 | protected Vector2 maxVelocity; |
---|
39 | |
---|
40 | protected float minLifetime; |
---|
41 | protected float maxLifetime; |
---|
42 | |
---|
43 | #endregion |
---|
44 | |
---|
45 | private int maxAmountOfParticles; |
---|
46 | public int MaxAmountOfParticles |
---|
47 | { |
---|
48 | get { return maxAmountOfParticles; } |
---|
49 | set { maxAmountOfParticles = value; } |
---|
50 | } |
---|
51 | |
---|
52 | public ParticleSystem(Game game, Vector2 position) |
---|
53 | : base(game) |
---|
54 | { |
---|
55 | this.game = game; |
---|
56 | } |
---|
57 | |
---|
58 | protected abstract void InitializeParticles(); |
---|
59 | |
---|
60 | protected override void LoadContent() |
---|
61 | { |
---|
62 | base.LoadContent(); |
---|
63 | } |
---|
64 | } |
---|
65 | } |
---|