Use arrow keys or WASD to move if you are on a PC, Touch the screen to move if you are on a mobile device. The enemy will be damaged and knocked back, if it touches the sword.
Enemies can go into the darkness, however, you cannot. There is a chance when you swing your sword where you can miss your target, but having fire trail can prevent that. Right before enemies die, the have immunity for 0.4 seconds Slimes have 2 hp Sword Skeletons have 6 hp (Note - if sword damage is greater than 2 but less than 6, you will 2 shot the skeleton)