title: How to scale the size of sprite dynamically in XNA + C#?
body: <p>I'm creating a 2D shooter and I would like to increase the size of certain enemies when collision occurs between that and a projectile object. 
  I can scale the sprite in the code by just changing the float value below</p>
  
  <pre><code>enemyAnimation.Initialize(enemyTexture, Vector2.Zero, 47, 61, 8, 30, Color.White, **2f**, true);
  </code></pre>
  
  <p>I can then change that float to a variable, and update the variable when a collision occurs. The only problem is, that the enemy scale does change but only for newly spawned enemies and all of them. This was obvious but what I want to be able to do (if at all possible) is change the size of the enemy that the collision occurred with and only that enemy...</p>
  
  <p>Any ideas on how I might go about doing this?</p>
  
  <p>EDIT:</p>
  
  <p>Okay, I am a little confused. I have created a float value called scaleSize in my Enemy class. Then in collision detection in my Game1.cs I am running a for loop to iterate through my list of enemy objects</p>
  
  <pre><code>// Projectile vs Enemy Collision
              for (int i = 0; i &lt; projectiles.Count; i++)
              {
                  for (int j = 0; j &lt; enemies.Count; j++)
                  {
                      // Create the rectangles we need to determine if we collided with each other
  
  
                      // Determine if the two objects collided with each other
                      if (rectangle1.Intersects(rectangle2))
                      {
  
                          enemies[j].Health -= projectiles[i].Damage;
                          projectiles[i].Active = false;
  
                              *enemies[j].scaleSize += 1f;*
                      }
                  }
              }
  </code></pre>
  
  <p>Now I realise scaleSize is not being initialized properly. But I am unsure of where I should change this. As above in the earlier code sample, the float value is changing the scale of the enemy but through the Animation class and if I change this, it changes for all enemies (afaik). 
  I am sorry as I know this is very vague but I just can't wrap my head around where I should set the enemies scale size. creating it enemy class is fine but it is not referencing the actual scale of the enemy.</p>