I’m making a hack-and-slash roguelike game. When you attack the enemies(when you are in collision with them and you press the space bar to attack), they take damage. And when they hit you(come in collision with you), you take damage. When I attack them, however, I deal damage and take damage. How do I make it so you can attack them without taking damage at the same time?
Any help would be greatly appreciated.