One of the most common skills for a player to work on is their stroke. Players may spend many hours perfecting the turn of the back, pendulum of the arm, rotation of the forearm, keeping the chest up and keeping the right angle between the racquet and forearm. But then they play a point and it all falls apart, or at least falters to a degree. The player who from a static position has a great stroke may not have such a great stroke in a dynamic situation. This is very, very common. Why does this happen?
In order to maintain the integrity of a stroke when you play you must understand the distinction between stroke and alignment. The stroke is the mechanics of swinging the racquet properly. Alignment is the relationship between you and the ball when you make contact. If the alignment between you and the ball is off, then by necessity you will need to modify the stroke to adjust to the position of the ball. And it is this modification of the stroke which causes the problems. If the alignment is correct, then you can maintain your stroke. And there is a slightly different alignment for every shot that you may want to hit. So proper movement and adjusting to the ball is essential for keeping a good stroke.
A good way to ingrain good alignment is to take practice swings adjusting both feet each time. Most people practice their stroke by planting their back foot and stepping forward with the front foot as they swing. If instead you slightly shuffle each foot and then step in with the front foot when you swing you will start to ingrain adjusting into your stroke, and will start to create good alignment to the ball.