kernal.py
def move_bullet(self, n):
        '''
        move bullet No.n, if interface with wall, barriers or cars, return True, else False
        if interface with cars, cars'hp will decrease
        '''
        old_point = self.bullets[n].center.copy()
        self.bullets[n].center[0] += self.bullets[n].speed * np.cos(np.deg2rad(self.bullets[n].angle))
        self.bullets[n].center[1] += self.bullets[n].speed * np.sin(np.deg2rad(self.bullets[n].angle))
        # bullet wall check
        if self.bullets[n].center[0] <= 0 or self.bullets[n].center[0] >= self.map_length \
            or self.bullets[n].center[1] <= 0 or self.bullets[n].center[1] >= self.map_width: return True
        # bullet barrier check
        for b in self.barriers:
            if self.line_barriers_check(self.bullets[n].center, old_point): return True
        # bullet armor check
        for i in range(len(self.cars)):
            if i == self.bullets[n].owner: continue
            if np.abs(np.array(self.bullets[n].center) - np.array(self.cars[i, 1:3])).sum() < 52.5:
                points = self.transfer_to_car_coordinate(np.array([self.bullets[n].center, old_point]), i)
                if self.segment(points[0], points[1], [-18.5, -5], [-18.5, 6]) \
                or self.segment(points[0], points[1], [18.5, -5], [18.5, 6]) \
                or self.segment(points[0], points[1], [-5, 30], [5, 30]) \
                or self.segment(points[0], points[1], [-5, -30], [5, -30]):
                    if self.compet_info[int(self.cars[i, 0]), 3]: self.cars[i, 6] -= 25
                    else: self.cars[i, 6] -= 50
                    return True
                if self.line_rect_check(points[0], points[1], [-18, -29, 18, 29]): return True
        return False

        move bullet No.n, if interface with wall, barriers or cars, return True, else False
        if interface with cars, cars'hp will decrease
        
move bullet No.n, if interface with wall, barriers or cars, return True, else False
if interface with cars, cars'hp will decrease
move bullet No . n if interface with wall barriers or cars return True else False if interface with cars cars ' hp will decrease
def move_bullet(self, n):
        old_point = self.bullets[n].center.copy()
        self.bullets[n].center[0] += self.bullets[n].speed * np.cos(np.deg2rad(self.bullets[n].angle))
        self.bullets[n].center[1] += self.bullets[n].speed * np.sin(np.deg2rad(self.bullets[n].angle))
        if self.bullets[n].center[0] <= 0 or self.bullets[n].center[0] >= self.map_length \
            or self.bullets[n].center[1] <= 0 or self.bullets[n].center[1] >= self.map_width: return True
        for b in self.barriers:
            if self.line_barriers_check(self.bullets[n].center, old_point): return True
        for i in range(len(self.cars)):
            if i == self.bullets[n].owner: continue
            if np.abs(np.array(self.bullets[n].center) - np.array(self.cars[i, 1:3])).sum() < 52.5:
                points = self.transfer_to_car_coordinate(np.array([self.bullets[n].center, old_point]), i)
                if self.segment(points[0], points[1], [-18.5, -5], [-18.5, 6]) \
                or self.segment(points[0], points[1], [18.5, -5], [18.5, 6]) \
                or self.segment(points[0], points[1], [-5, 30], [5, 30]) \
                or self.segment(points[0], points[1], [-5, -30], [5, -30]):
                    if self.compet_info[int(self.cars[i, 0]), 3]: self.cars[i, 6] -= 25
                    else: self.cars[i, 6] -= 50
                    return True
                if self.line_rect_check(points[0], points[1], [-18, -29, 18, 29]): return True
        return False
def move_bullet ( self , n ) : old_point = self . bullets [ n ] . center . copy ( ) self . bullets [ n ] . center [ 0 ] += self . bullets [ n ] . speed * np . cos ( np . deg2rad ( self . bullets [ n ] . angle ) ) self . bullets [ n ] . center [ 1 ] += self . bullets [ n ] . speed * np . sin ( np . deg2rad ( self . bullets [ n ] . angle ) ) if self . bullets [ n ] . center [ 0 ] <= 0 or self . bullets [ n ] . center [ 0 ] >= self . map_length or self . bullets [ n ] . center [ 1 ] <= 0 or self . bullets [ n ] . center [ 1 ] >= self . map_width : return True for b in self . barriers : if self . line_barriers_check ( self . bullets [ n ] . center , old_point ) : return True for i in range ( len ( self . cars ) ) : if i == self . bullets [ n ] . owner : continue if np . abs ( np . array ( self . bullets [ n ] . center ) - np . array ( self . cars [ i , 1 : 3 ] ) ) . sum ( ) < 52.5 : points = self . transfer_to_car_coordinate ( np . array ( [ self . bullets [ n ] . center , old_point ] ) , i ) if self . segment ( points [ 0 ] , points [ 1 ] , [ - 18.5 , - 5 ] , [ - 18.5 , 6 ] ) or self . segment ( points [ 0 ] , points [ 1 ] , [ 18.5 , - 5 ] , [ 18.5 , 6 ] ) or self . segment ( points [ 0 ] , points [ 1 ] , [ - 5 , 30 ] , [ 5 , 30 ] ) or self . segment ( points [ 0 ] , points [ 1 ] , [ - 5 , - 30 ] , [ 5 , - 30 ] ) : if self . compet_info [ int ( self . cars [ i , 0 ] ) , 3 ] : self . cars [ i , 6 ] -= 25 else : self . cars [ i , 6 ] -= 50 return True if self . line_rect_check ( points [ 0 ] , points [ 1 ] , [ - 18 , - 29 , 18 , 29 ] ) : return True return False
move bullet No.n, if interface with wall, barriers or cars, return True, else False
if interface with cars, cars'hp will decrease
move bullet No . n if interface with wall barriers or cars return True else False if interface with cars cars ' hp will decrease
'''
        move bullet No.n, if interface with wall, barriers or cars, return True, else False
        if interface with cars, cars'hp will decrease
        ''' # bullet wall check
 # bullet barrier check
 # bullet armor check

self
n