public ProjectileStarParticle(ContentManager Content, string spriteName,
     PixelUnit sourceX, PixelUnit sourceY,
     PixelUnit sourceWidth, PixelUnit sourceHeight,
     int fps, FrameUnit numFrames,
     GameUnit x, GameUnit y)
     : base(Content, spriteName,
           sourceX, sourceY,
           sourceWidth, sourceHeight,
           fps, numFrames, x, y)
 {
 }
Example #2
0
 public AnimatedSprite(ContentManager Content,
                       string fileName,
                       PixelUnit sourceX, PixelUnit sourceY,
                       PixelUnit width, PixelUnit height,
                       int fps, FrameUnit numberOfFrames) : base(Content, fileName, sourceX, sourceY, width, height)
 {
     frameTimer          = new Timer(TimeSpan.FromMilliseconds(1000 / fps));
     this.numberOfFrames = numberOfFrames;
     currentFrame        = 0;
     numCompletedLoops   = 0;
 }
 public ProjectileStarParticle(ContentManager Content, string spriteName,
                               PixelUnit sourceX, PixelUnit sourceY,
                               PixelUnit sourceWidth, PixelUnit sourceHeight,
                               int fps, FrameUnit numFrames,
                               GameUnit x, GameUnit y)
     : base(Content, spriteName,
            sourceX, sourceY,
            sourceWidth, sourceHeight,
            fps, numFrames, x, y)
 {
 }
Example #4
0
 public AnimatedSprite(ContentManager Content,
     string fileName,
     PixelUnit sourceX, PixelUnit sourceY,
     PixelUnit width, PixelUnit height,
     int fps, FrameUnit numberOfFrames)
     : base(Content, fileName, sourceX, sourceY, width, height)
 {
     frameTimer = new Timer(TimeSpan.FromMilliseconds(1000 / fps));
     this.numberOfFrames = numberOfFrames;
     currentFrame = 0;
     numCompletedLoops = 0;
 }
 public ImmobileSingleLoopParticle(ContentManager Content, string spriteName,
     PixelUnit sourceX, PixelUnit sourceY,
     PixelUnit sourceWidth, PixelUnit sourceHeight,
     int fps, FrameUnit numFrames,
     GameUnit x, GameUnit y)
 {
     this.x = x;
     this.y = y;
     sprite = new AnimatedSprite(Content, spriteName,
         sourceX, sourceY,
         sourceWidth, sourceHeight,
         fps, numFrames);
 }
 public ImmobileSingleLoopParticle(ContentManager Content, string spriteName,
                                   PixelUnit sourceX, PixelUnit sourceY,
                                   PixelUnit sourceWidth, PixelUnit sourceHeight,
                                   int fps, FrameUnit numFrames,
                                   GameUnit x, GameUnit y)
 {
     this.x = x;
     this.y = y;
     sprite = new AnimatedSprite(Content, spriteName,
                                 sourceX, sourceY,
                                 sourceWidth, sourceHeight,
                                 fps, numFrames);
 }
Example #7
0
 public override void Update()
 {
     if (frameTimer.Expired)
     {
         currentFrame++;
         frameTimer.Reset();
         if (currentFrame < numberOfFrames)
         {
             sourceRect.X += sourceRect.Width;
         }
         else
         {
             sourceRect.X -= sourceRect.Width * (numberOfFrames - 1);
             currentFrame = 0;
             numCompletedLoops++;
         }
     }
 }
Example #8
0
 public override void Update()
 {
     if (frameTimer.Expired)
     {
         currentFrame++;
         frameTimer.Reset();
         if (currentFrame < numberOfFrames)
         {
             sourceRect.X += sourceRect.Width;
         }
         else
         {
             sourceRect.X -= sourceRect.Width * (numberOfFrames - 1);
             currentFrame  = 0;
             numCompletedLoops++;
         }
     }
 }