consolidated movePlayer function