I am not a teacher.
None of these make sense to me.
If I understand you correctly, you have been invited to play basketball but you haven't gone yet. It is something that (if it happens at all) will take place in the future.
I would use "I'll" in this situation, making the appropriate changes to the rest of the sentences of course.
'I'll come if I can'.
'I'll come if I'm in town'.
"I'd" would be suitable if you already know that you aren't coming (or going) and want to explain why not.
'I'd love to, but I'll be out of town'.
'I'd come if I enjoyed basketball, but I don't so you won't be seeing me there'.