When you get pain in your chest from movement, then it is usually not your heart. I was told it is called Positional Pain. It is caused by your muscles. Did you lift or do any kind of excercise recently?
just to be cautious please tell a parent and go to the doctor. But most likely you could have pulled something and it is sensitive now especially when coughing. But go to the doctor you could possibly have even cracked a rib which can cause the same pains.
I think costochondritis should be considered.
Ribs are connected to a sternum by fibrous and cartilage tissue. Sometimes these cartilage portions may got inflammation after some minor injuries. As a consequence, it will be hurt when they are moved or pressed. NSAID, such as diclofenac or naproxen can do great relief.