I loaded a ducking png for my sprite, so when I press the down arrow, he ducks and when he ducks the rectangle gets smaller, which is good, but the rectangle seems like the sprite is floating instead of ducking at the place he is. It's like he sits on the air. How can I fix it?
Two options - 

You could make the ducking graphic the same size as the regular standing graphic, and just place the sprite in the bottom part of the image (with the rest transparent)
You could reposition the box manually to move the y-position nearer to the ground when the ducking occurs

Of these, the first is the easiest to implement, but the second would be necessary if you're also using the rectangle for e.g. hit-testing.
How can I make a sprite duck with a ducking png?