//onCollisionwithPlayer() changes the direction of the ball.
//It also changes the speed of the ball if it has not been increased by a collision with another player.
onCollisionwithPlayer() changes the direction of the ball.
It also changes the speed of the ball if it has not been increased by a collision with another player.
// onCollisionwithPlayer () changes the direction of the ball . // It also changes the speed of the ball if it has not been increased by a collision with another player .
func onCollisionwithPlayer(ball *Ball, teamid int32, lastMotion int32) {
	if (ball.Xv < 0 && teamid == 1) || (ball.Xv > 0 && teamid == 2) {
		ball.Xv = -ball.Xv
	}
	if math.Abs(ball.Xv) <= BallSpeedX {
		ball.Xv *= 2
		ball.Yv *= 2
	}
	ball.Yv += float64(lastMotion) * 0.2
}
func onCollisionwithPlayer ( ball * Ball , teamid int32 , lastMotion int32 ) { if ( ball . Xv < 0 && teamid == 1 ) || ( ball . Xv > 0 && teamid == 2 ) { ball . Xv = - ball . Xv } if math . Abs ( ball . Xv ) <= BallSpeedX { ball . Xv *= 2 ball . Yv *= 2 } ball . Yv += float64 ( lastMotion ) * 0.2 }
onCollisionwithPlayer() changes the direction of the ball.
onCollisionwithPlayer () changes the direction of the ball .