Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using Microsoft.Xna.Framework;
- using Microsoft.Xna.Framework.Graphics;
- namespace WindowsGame1
- {
- class Particle
- {
- public bool Active;
- Texture2D Texture;
- Vector2 InitialVel;
- public int Speed;
- public int Life;
- Vector2 Position;
- public void Initialize(Texture2D texture,Vector2 position, int speed, int life,Vector2 initialvel)
- {
- this.InitialVel = initialvel;
- Active = true;
- this.Position = position;
- Texture = texture;
- Speed = speed;
- Life = life;
- }
- public void Update(GameTime gameTime)
- {
- if (Active == true)
- {
- Position.X -= InitialVel.X ;
- Position.Y -= InitialVel.Y ;
- }
- }
- public void Draw(SpriteBatch spriteBatch)
- {
- spriteBatch.Draw(Texture, Position,null,Color.Yellow,0f,Vector2.Zero,.1f,SpriteEffects.None,0f);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement