With the project's code, if I recall correctly, your suggestion would make enemies get stuck on walls, as they rely on their current velocity to change direction. Only resetting the Y velocity prevents that bug.
1 love
R
RMDS
replied
Thank you Nathan! I tested with the enemy and yes it is exactly as you said!