Advertisement
Guest User

Untitled

a guest
Feb 16th, 2012
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.07 KB | None | 0 0
  1. using System;
  2. using Microsoft.Xna.Framework;
  3. using Microsoft.Xna.Framework.Graphics;
  4.  
  5. namespace WindowsGame1
  6. {
  7.     class Particle
  8.     {
  9.         public bool Active;
  10.         Texture2D Texture;
  11.         Vector2 InitialVel;
  12.         public int Speed;
  13.         public int Life;
  14.         Vector2 Position;
  15.        
  16.  
  17.         public void Initialize(Texture2D texture,Vector2 position, int speed, int life,Vector2 initialvel)
  18.         {
  19.             this.InitialVel = initialvel;
  20.             Active = true;
  21.             this.Position = position;
  22.             Texture = texture;
  23.             Speed = speed;
  24.             Life = life;
  25.            
  26.  
  27.  
  28.         }
  29.         public void Update(GameTime gameTime)
  30.         {
  31.             if (Active == true)
  32.             {
  33.                 Position.X -= InitialVel.X ;
  34.                 Position.Y -= InitialVel.Y ;
  35.             }
  36.         }
  37.        
  38.         public void Draw(SpriteBatch spriteBatch)
  39.         {
  40.             spriteBatch.Draw(Texture, Position,null,Color.Yellow,0f,Vector2.Zero,.1f,SpriteEffects.None,0f);
  41.         }
  42.     }
  43. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement