moved collision check inside player