what you had was probably muscle cramp.
muscle cramp can be due to various causes out of which most common is dehydration
as we see in the athletes and player. secondly it could be also because of low calcium and vitamin , cramps can also be due to anaemia
i advice you to contact your general physician get the investigations done to rule out the above causes. he will guide you after proper examination