Exemplo n.º 1
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)
 {
 }
Exemplo n.º 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;
 }
Exemplo n.º 3
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)
 {
 }
Exemplo n.º 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);
 }
Exemplo n.º 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++;
         }
     }
 }
Exemplo n.º 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++;
         }
     }
 }