//creates a new team and their coordinates are passed into  it manually
creates a new team and their coordinates are passed into  it manually
// creates a new team and their coordinates are passed into it manually
func newteam(renderer *sdl.Renderer, teamid int32) (t Team, err error) {
	offset := int32(0)
	if teamid == 2 {
		offset = BoxWidth - 1 - 2*playerWidth
	}
	t.GoalKeeper[0], err = newplayer(renderer, int32(math.Abs(float64(61-playerWidth-offset))), BoxHeight/2-playerHeight, teamid)
	if err != nil {
		fmt.Println(err)
		return Team{}, fmt.Errorf("%v", err)
	}
	for i := range t.Defence {
		t.Defence[i], err = newplayer(renderer, int32(math.Abs(float64(136-playerWidth-offset))), int32(BoxHeight*(i+1))/3-playerHeight, teamid)
		if err != nil {
			fmt.Println(err)
			return Team{}, fmt.Errorf("%v", err)
		}
	}
	for i := range t.Mid {
		t.Mid[i], err = newplayer(renderer, int32(math.Abs(float64(286-playerWidth-offset))), int32(BoxHeight*(i+1))/6-playerHeight, teamid)
		if err != nil {
			fmt.Println(err)
			return Team{}, fmt.Errorf("%v", err)
		}
	}
	for i := range t.Attack {
		t.Attack[i], err = newplayer(renderer, int32(math.Abs(float64(436-playerWidth-offset))), int32(BoxHeight*(i+1))/4-playerHeight, teamid)
		if err != nil {
			fmt.Println(err)
			return Team{}, fmt.Errorf("%v", err)
		}
	}
	return t, nil
}
func newteam ( renderer * sdl . Renderer , teamid int32 ) ( t Team , err error ) { offset := int32 ( 0 ) if teamid == 2 { offset = BoxWidth - 1 - 2 * playerWidth } t . GoalKeeper [ 0 ] , err = newplayer ( renderer , int32 ( math . Abs ( float64 ( 61 - playerWidth - offset ) ) ) , BoxHeight / 2 - playerHeight , teamid ) if err != nil { fmt . Println ( err ) return Team { } , fmt . Errorf ( " " , err ) } for i := range t . Defence { t . Defence [ i ] , err = newplayer ( renderer , int32 ( math . Abs ( float64 ( 136 - playerWidth - offset ) ) ) , int32 ( BoxHeight * ( i + 1 ) ) / 3 - playerHeight , teamid ) if err != nil { fmt . Println ( err ) return Team { } , fmt . Errorf ( " " , err ) } } for i := range t . Mid { t . Mid [ i ] , err = newplayer ( renderer , int32 ( math . Abs ( float64 ( 286 - playerWidth - offset ) ) ) , int32 ( BoxHeight * ( i + 1 ) ) / 6 - playerHeight , teamid ) if err != nil { fmt . Println ( err ) return Team { } , fmt . Errorf ( " " , err ) } } for i := range t . Attack { t . Attack [ i ] , err = newplayer ( renderer , int32 ( math . Abs ( float64 ( 436 - playerWidth - offset ) ) ) , int32 ( BoxHeight * ( i + 1 ) ) / 4 - playerHeight , teamid ) if err != nil { fmt . Println ( err ) return Team { } , fmt . Errorf ( " " , err ) } } return t , nil }
creates a new team and their coordinates are passed into  it manually
creates a new team and their coordinates are passed into it manually