Accidentally killing someone is not, in general, illegal. It typically would be if you did it while driving a car, as in this instance it would probably result from negligence on your part. But if you, say, trip over, bump into someone and then accidentally knock them off a ledge, you haven't committed a crime.
I mean to say that intent (and other aspects of mental state) can influence the severity of punishment.
It shouldn't determine whether something is legal, however.
Hitting pedestrians ought to be illegal regardless of whether you intended to do it or not.