Should I worry?!

I'm 39 weeks & 2 days, as I was lying in bed I noticed baby started moving like crazy for a good 45 mins, the movements were so crazy that sometimes they would actually hurt, now baby isn't moving at all, although I haven't moved since they started so maybe baby just wore herself out? Or should I be worried about something more serious? Is she in distress or something? Please HELP!