Moved the position update blocks of code of enemy and player in their own function.