refactor, player_intersects_block func