collision detection – Implementing melee combat in pygame?

I’ve gone about 2 ways for implementing melee attacks however, bboth have major flaws, hoping someone has a simpler answer.

Method 1:
Creating a “projectile” that’s using an image, then reducing the transparency of said image. Then offsetting the projectile to be at the end of the character sprite then have it kill itself after 10 milliseconds. This works however it does have a draw back that the more I make the image of the projectile transparent at a certain % pygame stops reading it as an image, it will show the rect but will not allow for collision with enemies. Also if you use mask collision instead of direct rect collision, you damage yourself.

Method 2:
Much like the first is a rect that is offset in front of the player, if the hit rect of the object collides with the hit rect of the enemy, that’s read as a hit. The drawback is if you get too close the mask collision used for the player/enemy sprite is activated and you take damage. Masking cannot be used with this method as it would read the player’s sprite as a collision, meaning you hurt yourself to hurt the enemy.