Everything you do in adventure mode is measured by units of time.
When you pressed the "." as Broseph Stalin pointed out, 10 instants (10 units of time passed). If you had pressed "," only 1 instant would have passed. Since that Night Troll (which is always very very fast) was sprinting towards you, it not only moved to the tile adjacent (next) to you in those the 10 instants, but it also had time to strike or grab you well before you got to do anything.
Keeping that in mind, I'd suggest a more specific form of Bumber's advice as a good experiment/way to learn how to fight.
Do solo fights. Fight one creature by yourself (here skip the companions/go against multiple opponents because they'll cause more randomness in the outcomes). One on one is something that you can control. When you are fighting, try to control everything that happens.
The example is you are fighting a bear:
B≈≈≈
≈≈@≈
≈≈≈≈
1-You see the green direction arrow. Where it's moving.
2-You press "," until it moves to the tile adjacent (next) to you.
3-The green arrow goes away.
4-Now you press "," again.
5-You see the red direction arrow. It's attacking.
6-Now you do something.
7, 8, 9, etc-What happens here? Why did that happen?
So everything from 2-5 you've controlled. 6 you controlled, *but* did that make 7 something you, not just wanted, but knew would happen?
If you can consistently control almost everything, and only gamble on the randomness where you know it will be, you can use a peasant to kill pretty much anything (including that night troll) on day one without powerleveling. There's times you'll die of course, but you'll know why everything happened.