how to add attack system in a platformer game
The sample project comes with basic platformer enemy collision scripts. You can modify those to subtract health or kill the player when they touch an enemy.
You could also set the player to fire a projectile when a certain button is pressed, and you can make the enemy take damage when being hit by said projectile.
Here's an example from the game that I'm making:
By the way, to get the smoke effect, I had the enemy fire a projectile with the speed set to None.