consolidate hero movement check into a function