Changeset 819 for 2010/23/sijoseha/alpha/Effects/Particle.cs
- Timestamp:
- 2010-06-14 14:56:07 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
2010/23/sijoseha/alpha/Effects/Particle.cs
r802 r819 16 16 class Particle 17 17 { 18 private ParticleGame game; 19 Random random = new Random(); 18 19 #region Variables, getters and setters 20 20 21 private Vector2 position; 21 22 public Vector2 Position … … 30 31 get { return texture; } 31 32 set { texture = value; } 32 }33 34 private Texture2D innerTexture;35 public Texture2D InnerTexture36 {37 get { return innerTexture; }38 set { innerTexture = value; }39 33 } 40 34 … … 88 82 } 89 83 90 public Particle(ParticleGame game, Texture2D texture, Texture2D innerTexture, Vector2 position, float lifetime) 84 #endregion 85 86 public void Initialize(Texture2D texture, Vector2 position, float scale, float rotation, Vector2 velocity, float lifetime) 91 87 { 92 88 this.alive = true; 93 this.game = game;94 89 this.texture = texture; 95 this.innerTexture = innerTexture;96 90 this.position = position; 97 this.Scale = 1.0f; 98 this.Rotation = 1.0f; 91 this.scale = scale; 99 92 this.lifetime = lifetime; 100 this.Origin = new Vector2(texture.Width / 2, texture.Height / 2); 93 this.rotation = rotation; 94 this.origin = new Vector2(texture.Width / 2, texture.Height / 2); 95 96 this.currentTime = 0.0f; 97 } 98 99 /// <summary> 100 /// Updates particles position 101 /// TODO: 102 /// - Update for rotation, velocity etc. 103 /// </summary> 104 /// <param name="time"></param> 105 public void Update(float time) 106 { 107 this.position = velocity * time; 108 this.currentTime += time; 101 109 } 102 110 }
Note: See TracChangeset
for help on using the changeset viewer.