Are you prone to panic attacks? Have you had them before? It could be panic or it could be something with the heart so I agree with the previous poster. And I also agree that odds are it isn't anything that puts you in immediate danger but it may be something that needs attention so just try to go see a doctor. If you were dehydrated for any reason, those energy drinks have a lot of caffeine and sugar, that could be part of it. But it important to see a doctor to get checked out so let your parents know what happened and go get seen by a doctor. But if it happens again just try to calm yourself and breath. You can try holding your breath and bearing down like you are straining to go to the bathroom. That can sometimes break up the fast beat. But most important take it slow and easy. Take care.
Did you eat, drink or take anything unusual recently, like energy drinks? There is no need to panic. Try some meditation tricks like taking deep slow breaths and concentrate on exhaling and inhaling. The worst thing is that it is some form of SVT such as WPW and it is not acutely dangerous and very curable. Let your parents know what happened and look for an electrophysiologist referral if it happens again.