Speaking seriously now: yes, when you swing a bat, some fool can step inside your range. But the counter for that is to STEP WHILE SWINGING. Every single swing should happen with footwork, usually back and sideways, sometimes forward and sideways. That'll clobber the SOB as he tries it.
If you miss, fine, at least you're the hell out of the way and can try again.
The other thing is, your first connect or two should be to the legs or back of the knees of the opponent. Slow the sucker down, then clobber him. With an armed criminal assailant, perfection is one shot to the upper calf to buckle him, another to the back of the skull, with footwork rotating to the outside on EACH stroke. You step AWAY FROM his weapon, usually to your right but if he's a southpaw, go the other way. Do it fast, don't hold back, don't show mercy, because wolves run in packs.
There's always one more bad guy that you ain't spotted yet.