Exemplo n.º 1
0
def get(win, min_x, min_y, min_z, len,quantity,fname):
    # Ещё раз считываем obj файл, для записи точек(с нормалями), и разбиения на треугольники.
    if (min_x > 0):
        min_x = 0
    if (min_y > 0):
        min_y = 0
    if (min_z > 0):
        min_z = 0
    f = open(fname, 'r')
    new = QColor()
    lines = f.read()
    i = 0
    j = 0
    k = 0
    points = np.empty(shape = (len,), dtype = Point)
    triangl_normals = np.empty(shape = (len,), dtype= for_normals)
    for l in range(len):
        triangl_normals[l] = for_normals()
    world_coords = np.empty(shape = (3,), dtype= Point)
    communication = np.empty(shape = (quantity,), dtype = Point)
    normals = np.empty(shape = (len,), dtype = vector)
    for line in lines.split('\n'):

        try:
            v, x, y, z = re.split('\s+', line)

        except:
            try:
                v, x, y, z = re.split('\s+', line[:-1])
            except:
                continue

        if v == 'v':
            points[i] = Point(float(x) - min_x, float(y) - min_y, float(z) - min_z, None)

            i += 1
        if v == 'f':
            world_coords[0] = points[int(x.split('/')[0]) - 1]
            world_coords[1] = points[int(y.split('/')[0]) - 1]
            world_coords[2] = points[int(z.split('/')[0]) - 1]
            n = (world_coords[2] - world_coords[0]) ** (world_coords[1] - world_coords[0])
            n =  vector(n.x,n.y,n.z)
            q = n.normolize()
            triangl_normals[int(x.split('/')[0]) - 1].for_no.append(q)
            triangl_normals[int(y.split('/')[0]) - 1].for_no.append(q)
            triangl_normals[int(z.split('/')[0]) - 1].for_no.append(q)
            communication[j] = [points[int(i.split('/')[0])-1] for i in (x, y, z)]
            j += 1
    for i in range(len):
        points[i].norma = triangl_normals[i].get_medium()
    normolize_all(points)
    subject = Obj(points, communication)
    objects.add(subject)

    if win.flag == 0:
        show_all_models1(win)
    else:
        show_all_models2(win)
    f.close()
Exemplo n.º 2
0
def karkas(coords, win):
    # Отрисовка каркаса объекта прямыми.
    t1, t2, t3 = sorted(coords, key=lambda p: p.y)
    a = Point(t1.x, t1.y, t1.z, t1.norma)
    b = Point(t2.x, t2.y, t2.z, t1.norma)
    c = Point(t3.x, t3.y, t3.z, t1.norma)

    Bres_int(win, a, b)
    Bres_int(win, b, c)
    Bres_int(win, c, a)
Exemplo n.º 3
0
 def borderPaint(self):
     q = QPainter()
     for vertex in self.vertices:
         q.begin(self)
         brush = QBrush(Qt.BDiagPattern)
         pen = QPen(Qt.black, 1, Qt.DashLine)
         if self.pos and Point.dist(Point(self.pos.x(), self.pos.y()), vertex) <= 100:
             q.setBrush(brush)
         q.setPen(pen)
         q.drawEllipse(vertex.myQPoint(), 100, 100)
         q.end()
Exemplo n.º 4
0
 def makeVertexStartRoad(self, event):
     if event.button() == Qt.RightButton:
         point = Point(event.x(), event.y())
         if not self.vertices or self.mindistance(point) > 50:
             self.vertices.append(Vertex.newVertex(event.x(), event.y(), self.net))
     point = Point(event.x(), event.y())
     if event.button() == Qt.LeftButton and self.vertices and self.mindistance(point) <= 20:
         v = self.closestvertex(point)
         self.newroad = Road(v, self.net, self.n, self.isOneSided)
         self.basepoint = Point(v.x(), v.y())
         self.pointList.append(self.basepoint)
         self.signal.switch.emit()
Exemplo n.º 5
0
 def loadFromFile(self, verticeslist, roadlists):
     pass
     self.vertices = []
     self.roads = []
     for vcortege in verticeslist:
         self.vertices.append(Vertex.newVertex(vcortege[0], vcortege[1], self.net))
     i = 0
     for cortege in roadlists:
         n = cortege[0]
         bool = cortege[1]
         rlist = cortege[2]
         for vertex in self.vertices:
             if vertex.x() == rlist[0][0] and vertex.y() == rlist[0][1]:
                 begv = vertex
                 break
         road = Road(begv, self.net, n, bool)
         for vertex in self.vertices:
             if vertex.x() == rlist[-1][0] and vertex.y() == rlist[-1][1]:
                 endv = vertex
                 break
         points = []
         for cortege in rlist:
             points.append(Point(cortege[0], cortege[1]))
         road.found(points, endv)
         self.roads.append(road)
Exemplo n.º 6
0
 def mindistance(self, point):
     distlist = []
     for vertex in self.vertices:
         distlist.append(Point.dist(point, vertex))
     if distlist:
         return min(distlist)
     else:
         return None
Exemplo n.º 7
0
def find_all_points(soduko):
    points = get.all_empty_points(soduko)
    points_with_val = []
    for p in points:
        viable_val = get.shortest_way(p[0], p[1], soduko)
        temp = Point(p, viable_val)
        points_with_val.append(temp)
    return points_with_val
Exemplo n.º 8
0
 def waitForFinish(self, event):
     if event.button() == Qt.LeftButton:
         point = Point(event.x(), event.y())
         if self.mindistance(point) > 100:
             self.pointList.append(point)
             v = Vertex.newVertex(event.x(), event.y(), self.net)
             self.vertices.append(v)
             self.finishTheRoad(v)
Exemplo n.º 9
0
 def closestvertex(self, point):
     distlist = []
     for vertex in self.vertices:
         distlist.append(Point.dist(point, vertex))
     if distlist:
         index = distlist.index(min(distlist))
         return self.vertices[index]
     else:
         return None
Exemplo n.º 10
0
    def moveAndDraw(self, event):
        m = 1
        point = Point(event.x(), event.y())
        distance_from_previous_point = Point.dist(point, self.basepoint)
        self.pos = event.pos()
        if distance_from_previous_point >= m:
            if distance_from_previous_point >= 2*m:
                cos = (point.x() - self.basepoint.x()) / distance_from_previous_point
                sin = (point.y() - self.basepoint.y()) / distance_from_previous_point
                point = Point(self.basepoint.x() + round(cos), self.basepoint.y() + round(sin))
                for i in range(m, math.ceil(distance_from_previous_point), m):
                    self.pointList.append(point)
                    point = Point(self.basepoint.x() + round(cos*i), self.basepoint.y() + round(sin*i))
            self.pointList.append(point)
            self.basepoint = point

        if self.mindistance(point) <= 20 and len(self.pointList) >= 50:
            v = self.closestvertex(point)
            self.pointList.append(Point(v.x(), v.y()))
            self.finishTheRoad(v)
Exemplo n.º 11
0
def find_empty_points(soduko):
    points = []
    for pos in range(0, len(soduko.S)**2):
        down = math.floor(pos / len(soduko.S))
        right = pos % len(soduko.S)
        if soduko.S[down][right] == 0:
            points.append(
                Point([down, right],
                      check.revert_list(
                          get.values_for_pos(down, right, soduko), soduko)))
    return points
Exemplo n.º 12
0
def assignValues(soduko):
    points = []
    for pos in range(0, len(soduko.S)**2):
        down = math.floor(pos / len(soduko.S))
        right = pos % len(soduko.S)
        if soduko.S[down][right] == 0:
            points.append(
                Point([down, right],
                      check.revert_list(
                          get.values_for_pos(down, right, soduko), soduko)))
            #points.append(Point([down, right], check.revert_list(soduko.pos_val[Direction.Right][down], soduko)))
    return points
Exemplo n.º 13
0
 def finishTheRoad(self, v):
     for point in self.pointList:
         d = Point.dist(self.previous(point), point)
         if d == 0.0:
             self.pointList.remove(point)
     points = self.pointList.copy()
     road = self.newroad
     road.found(points, v)
     self.roads.append(road)
     self.pointList.clear()
     self.signal.switch.emit()
     self.pos = None
def find_random_point(parameters):
    """
	Return a random point P on the curve
	"""
    p, a, b = parameters
    possible_points = set()
    for i in range(p):
        y2 = (i**3 + a * i + b) % p
        for j in range(p):
            if (j**2) % p == y2:
                possible_points.add((i, j))
    P = secrets.choice(list(possible_points))
    return Point(P[0], P[1], (p, a, b))
def build_known_curves():
    """
	Load some know curves, i.e. secp256k1
	"""
    with open("known_curves.json", 'r') as f:
        data = json.load(f)
    curves = dict()
    for curve in data['curves']:
        name = curve['name']
        curves[name] = (int(curve['p'], 16), curve['a'], curve['b'],
                        Point(int(curve['G'][0], 16), int(curve['G'][1], 16),
                              (int(curve['p'], 16), curve['a'], curve['b'])),
                        int(curve['n'], 16), curve['h'])
    return curves
Exemplo n.º 16
0
 def allocate(self, event):
     point = Point(event.x(), event.y())
     if event.button() == Qt.LeftButton and self.vertices and self.mindistance(point) <= 20:
         if self.hasBegun == False:
             self.v1 = self.closestvertex(point)
             self.v1.setBeginning()
             self.hasBegun = True
         else:
             self.v2 = self.closestvertex(point)
             self.v2.setEnd()
         self.count += 1
         if self.count == 2:
             self.move(self, self.v1, self.v2)
             self.count = 0
             self.hasBegun = False
Exemplo n.º 17
0
 def get_turn_down(self, win):
     for j in self.points:
             y = j.y
             y = y - 325 / half_scr_y
             matr = np.matrix([[1, 0, 0, 0], \
                               [0, m.cos(-m.pi / 30), m.sin(-m.pi / 30), 0], \
                               [0, -m.sin(-m.pi / 30), m.cos(-m.pi / 30), 0], \
                               [0, 0, 0, 1]])
             matr = np.linalg.inv(matr)
             vector_turn = np.matrix([j.norma.x, j.norma.y, j.norma.z,0])
             vector_turn = vector_turn.dot(matr)
             new_v = vector(vector_turn[0, 0], vector_turn[0, 1], vector_turn[0, 2])
             new = Point(j.x, (y * m.cos(-m.pi / 30) + j.z * m.sin(-m.pi / 30))+325 / half_scr_y,-y * (m.sin(-m.pi / 30)) + j.z * m.cos(-m.pi / 30),new_v)
             j.y = new.y
             j.z = new.z
             j.norma = new.norma
     if win.flag == 0:
         show_all_models1(win)
     else:
         show_all_models2(win)
Exemplo n.º 18
0
    def turn_left_point(self, win):
        # Поворот вокруг оси оy вправо
        for j in self.points:
            x = j.x
            x = x - 325 / half_scr_y

            matr = np.matrix([[m.cos(-m.pi / 30), 0, m.sin(-m.pi / 30),0 ], \
                              [0,1 , 0, 0], \
                              [-m.sin(-m.pi / 30), 0, m.cos(-m.pi / 30),0],\
                              [0,0,0,1]])
            matr = np.linalg.inv(matr)
            vector_turn = np.matrix([j.norma.x,j.norma.y,j.norma.z,0])
            vector_turn = vector_turn.dot(matr)
            new_v = vector(vector_turn[0,0],vector_turn[0,1],vector_turn[0,2])
            new = Point(x*m.cos(-m.pi/30)+j.z*m.sin(-m.pi/30)+ 325 / half_scr_y,j.y,-x*m.sin(-m.pi/30) + j.z*m.cos(-m.pi/30),new_v)
            j.x = new.x
            j.z = new.z
            j.norma = new.norma
        if win.flag == 0:
            show_all_models1(win)
        else:
            show_all_models2(win)
Exemplo n.º 19
0
    def turn_z_left_point(self,win):
        for j in self.points:
            x = j.x
            x = x - 325 / half_scr_y
            y = j.y
            y = y - 325 / half_scr_y

            matr = np.matrix([[m.cos(m.pi / 30), -m.sin(m.pi / 30), 0 , 0], \
                              [m.sin(m.pi / 30), m.cos(m.pi / 30), 0, 0], \
                              [0, 0, 1,0],\
                              [0, 0, 0, 1]])
            matr = np.linalg.inv(matr)
            vector_turn = np.matrix([j.norma.x,j.norma.y,j.norma.z,0])
            vector_turn = vector_turn.dot(matr)
            new_v = vector(vector_turn[0,0],vector_turn[0,1],vector_turn[0,2])
            new = Point(x*m.cos(m.pi/30)-y*m.sin(m.pi/30),x*m.sin(m.pi/30) + y*m.cos(m.pi/30),j.z,new_v)
            j.x = new.x + 325 / half_scr_y
            j.y = new.y +325 / half_scr_y
            j.norma = new.norma
        if win.flag == 0:
            show_all_models1(win)
        else:
            show_all_models2(win)
Exemplo n.º 20
0
def sidecurve(points, l):
    points1 = []
    points2 = []
    n = 10
    for i in range(n, len(points) - n):
        if onLine(points[i - n], points[i], points[i + n]) == False:
            p = center(points[i - n], points[i], points[i + n])
            p1 = Point(round(points[i].x() + (p.x() - points[i].x())*l/Point.dist(points[i], p)), round(points[i].y() + (p.y() - points[i].y())*l/Point.dist(points[i], p)))
            p2 = Point(round(points[i].x() - (p.x() - points[i].x()) * l / Point.dist(points[i], p)),
                   round(points[i].y() - (p.y() - points[i].y()) * l / Point.dist(points[i], p)))
            if lower(points[i-n], points[i], p1):
                points1.append(p1)
                points2.append(p2)
            else:
                points1.append(p2)
                points2.append(p1)
        else:
            n1 = points[i].y() - points[i - n].y()
            n2 = points[i - n].x() - points[i].x()
            #print(n1, n2)
            mod = (n1 ** 2 + n2 ** 2) ** 0.5
            p1 = Point(round(points[i].x() - n1 * l / mod), round(points[i].y() - n2 * l / mod))
            p2 = Point(round(points[i].x() + n1 * l / mod), round(points[i].y() + n2 * l / mod))
            #print(p1, p2)
            #if lower(points[i - 2], points[i], points1[-1]) == lower(points[i - 2], points[i], p1):
            if lower(points[i - n], points[i], p1):
                points1.append(p1)
                points2.append(p2)
            else:
                points1.append(p2)
                points2.append(p1)
            #else:
             #       points1.append(p2)
             #       points2.append(p1)

    return [points1, points2]
Exemplo n.º 21
0
 def previous(self, point):
     i = self.pointList.index(point)
     if i != 0:
         return self.pointList[i - 1]
     else:
         return Point(-1, -1)
Exemplo n.º 22
0
 def __init__(self, x=0, y=0, radius=1):
     if radius < 0:
         raise ValueError("promien ujemny")
     self.pt = Point(x, y)
     self.radius = radius
Exemplo n.º 23
0
def triangle(coords, win, zbufer,rte,light_dir):

    new = QColor()
    #Отрисовка поверхности треугольниками. Внимание тут будет дописан Гуро!!!
    a = Point(coords[0].x, coords[0].y, coords[0].z, coords[0].norma)
    b = Point(coords[1].x, coords[1].y, coords[1].z, coords[1].norma)
    c = Point(coords[2].x, coords[2].y, coords[2].z, coords[2].norma)

    min_m = min(half_scr_x,half_scr_y)
    # Преобразование координат к экранным
    a.x = int(a.x * min_m )+ 150
    a.y = 650 - int(a.y * min_m )
    a.z = a.z * min_m
    b.x = int(b.x * min_m ) + 150
    b.y = 650 - int(b.y * min_m )
    b.z = b.z * min_m
    c.x = int(c.x * min_m ) +150
    c.y = 650 - int(c.y * min_m )
    c.z = c.z * min_m
    #Сортировка по возростанию y
    a,b,c = sorted([a,b,c], key=lambda p: p.y)

    I1 = ligh * light_dir.mul(a.norma)
    I2 = ligh * light_dir.mul(b.norma)
    I3 = ligh * light_dir.mul(c.norma)
    # Вырожденный треугольник
    if a.y == b.y and a.y == c.y:
        return rte
    win.pen.setColor(new)

    total_height = c.y - a.y
    win.pen.setColor(new)
    # Цикл по всем строкам треугольника. Каждую строку закрашиваем.
    for i in range(total_height):
        # Сначала вычисляем границы строки
        test = (i > b.y - a.y) or(b.y == a.y)

        if test:
            seg = c.y - b.y
        else:
            seg = b.y - a.y
        first = Point(i/total_height, 1, 1,0)

        if test:
            second = Point((i - b.y + a.y)/seg, 1, 1,0)
        else:
            second = Point(i/seg, 1, 1,0)
        al = a + (c - a) * first

        if test:
            bl = b + (c - b) * second
        else:
            bl = a + (b - a) * second

        #линейная интерполяция
        if test == False and a.y != b.y:
            Ia = abs(I1 + ((I2 - I1)/(b.y - a.y))*(i))
        elif test and b.y != c.y:
            Ia = abs(I2 + ((I3 - I2)/(c.y - b.y))*(a.y + i - b.y))
        else:
            Ia = abs(I1 + (I2 - I1) * (i))
        if (c.y != a.y):
            Ib = abs(I1 + ((I3 - I1)/(c.y - a.y))*(i))
        else:
            Ib =abs( I1 + (I3 - I1) * (i))
        if al.x > bl.x:
            al, bl = bl, al
        else:
            Ia, Ib = Ib, Ia

        # Идём от одной вычесленной границы до другой
        # Пока нет защиты от выхода за границы экрана.
        for j in range(int(al.x),int(bl.x)+1):

            if al.x == bl.x:
                phi = 1
            else:
                phi = (j - al.x)/(bl.x - al.x)

            p = Point(j,a.y+i,al.z + (bl.z-al.z)*phi,0)
            idx = int(p.x+p.y*width)
            # Применяем z-буфер


            if (bl.x - al.x) == 0:
                I = abs(Ia + (Ib - Ia)*(p.x-al.x))
            else:
                I = abs(Ia + (Ib - Ia)/(bl.x - al.x)*(p.x - al.x))
            #new.setRgb( int(I),int(I),int(I))
            try:
                if (zbufer[idx] < p.z):
                    zbufer[idx] = p.z

                    #win.image.setPixel(p.x, p.y, win.pen.color().rgb())
                    if p.x < 780 and p.x > 0 and p.y< 650 and p.y > 0:

                        win.image.setPixel(p.x, p.y,qRgb(int(I), int(I), int(I)))
            except:
                return rte
    return rte
Exemplo n.º 24
0
	def __init__(self, x=0, y=0, r=1):
		if r < 0:
			raise ValueError("promień ujemny")
		self.pt = Point(x, y)
		self.r = r
Exemplo n.º 25
0
#pygame settings
pygame.init()
pygame.display.set_caption("Traveling Salesman Problem")
screen = pygame.display.set_mode((config.width, config.height))
clock = pygame.time.Clock()
start = time.time()

# Generate random points on screen
for n in range(config.number_of_points):
    x = random.randint(config.offset_screen,
                       config.width - config.offset_screen)
    y = random.randint(config.offset_screen,
                       config.height - config.offset_screen)

    point = Point(x, y)
    config.points.append(point)

config.dist = pythag.calculate_distance(config.points)
config.shortest_distance = config.dist

config.shortest_path = config.points.copy()
config.count = 0
running = True
while running:
    screen.fill(config.black)
    clock.tick(config.fps)
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
Exemplo n.º 26
0
    def movement(self, net):
        if self.current_vertex == self.finish_vertex:  ## if arrives
            return

        if self.current_vertex == self.start_vertex:  ## if starts, where
            self.where = self.way(net, self.start_vertex)
            if self.where == None:
                return
            best_len = inf
            self.best_road = 0
            for road in net.matrix[self.current_vertex][self.where].keys():
                if net.matrix[self.current_vertex][
                        self.where][road]['weight'] < best_len:
                    best_len = net.matrix[self.current_vertex][
                        self.where][road]['weight']
                    self.best_road = road

        vmin = 2
        self.future_best_road = 0
        self.future_where = self.where
        distance = len(net.matrix[self.current_vertex][self.where][
            self.best_road]['dots'])  ## traffic
        for i in range(distance):
            if self.where != self.finish_vertex and distance == i + 30:  ## where
                self.future_where = self.way(net, self.where)
                best_len = inf
                self.future_best_road = 0
                for road in net.matrix[self.where][self.future_where].keys():
                    if net.matrix[self.where][
                            self.future_where][road]['weight'] < best_len:
                        best_len = net.matrix[self.where][
                            self.future_where][road]['weight']
                        self.future_best_road = road

            if distance < 200:  ## to determine velocity
                accel = distance / 2
            else:
                accel = 100
            if i <= accel:
                self.current_velocity = math.sqrt(vmin**2 + i / accel *
                                                  (self.velocity**2 - vmin**2))
                self.report_velocity()

            if distance <= i + accel - 1:
                self.current_velocity = math.sqrt(self.velocity**2 -
                                                  (accel - distance + i + 1) /
                                                  accel *
                                                  (self.velocity**2 - vmin**2))
                self.report_velocity()
            if i != 0:
                time.sleep(1 / self.current_velocity)

            no_wait = 0  ## when may go
            if distance > i + 10:
                while net.matrix[self.current_vertex][self.where][
                        self.best_road]['on_road'][i + 10] != 0:
                    time.sleep(1 / waiting)

            else:
                while no_wait == 0 and self.where != self.finish_vertex:
                    no_wait = 1

                    for vertex_predecessors in net.matrix.predecessors(
                            self.where):
                        for road in net.matrix[vertex_predecessors][
                                self.where].keys():
                            if vertex_predecessors != self.current_vertex or road != self.best_road:  ## vertex_predecessors
                                first_angle = net.matrix[self.where][
                                    self.future_where][self.future_best_road][
                                        'start_angle']  ## edge
                                second_angle = net.matrix[self.current_vertex][
                                    self.where][self.best_road][
                                        'finish_angle']  ## edge
                                other_angle = net.matrix[vertex_predecessors][
                                    self.where][road]['finish_angle']
                                len_road = len(net.matrix[vertex_predecessors][
                                    self.where][road]['on_road'])
                                if second_angle < first_angle and second_angle < other_angle and other_angle < first_angle\
                                        or second_angle < other_angle and second_angle > first_angle\
                                        or second_angle > first_angle and second_angle > other_angle and first_angle > other_angle:
                                    for j in range(len_road - 30, len_road):
                                        if net.matrix[vertex_predecessors][
                                                self.where][road]['on_road'][
                                                    j] != 0:
                                            if net.matrix[vertex_predecessors][
                                                    self.
                                                    where][road]['on_road'][
                                                        j].future_best_road == self.future_best_road:
                                                no_wait *= 0

                    for close in nx.neighbors(net.matrix,
                                              self.where):  ##do not merge
                        for road in net.matrix[self.where][close].keys():
                            num = 0
                            for point in net.matrix[
                                    self.where][close][road]['on_road']:
                                if num > 10 - distance + 1 + i:
                                    break
                                num += 1
                                if point == 1:
                                    no_wait *= 0

                    if no_wait == 0:
                        time.sleep(1 / waiting)

            #if i < 35 or i > 400:
            #    print(i, self.velocity)
            #print(self.current_velocity)
            net.matrix[self.current_vertex][self.where][
                self.best_road]['on_road'][i] = self  ## car on road
            if i > 0:
                net.matrix[self.current_vertex][self.where][
                    self.best_road]['on_road'][i - 1] = 0

            self.current_point = net.matrix[self.current_vertex][self.where][
                self.best_road]['dots'][i]
            point = Point(self.current_point[0], self.current_point[1])

            self.tracker.setPos(point)

        net.matrix[self.current_vertex][self.where][self.best_road]['on_road'][
            distance - 1] = 0
        self.current_vertex = self.where
        self.where = self.future_where
        self.best_road = self.future_best_road
        self.movement(net)
Exemplo n.º 27
0
    def __init__(self, size, title):
        pygame.init()
        pygame.font.init()

        self.window = Window(size, title)
        self.clock = pygame.time.Clock()
        self.stop = True
        self.running = True
        self.manager = GameManager(self.window)
        self.win = True
        self.restart = False

        self.ghost_speed = 3
        self.count_for_music = 0

        self.count = 0
        self.font = pygame.font.SysFont("Consolas", 60)

        self.spr_sheet = load_image("pacman-sheet.png")
        self.animation = Animation(self.spr_sheet, (730, 310), (80, 101),
                                   (1, 5))
        self.map = Map("map.txt",
                       load_image("maze_tile.png"), (16, 16),
                       draw_offset=(13, 80))

        # Pacman
        self.move = (-5, 0)
        self.pacman = Pacman(self.animation, 235, 465, self.move, 3)
        self.rotate = 0

        # Создание еды
        self.points = []
        self.points_coords = COORD_FOOD

        self.point_animations = []
        for i in range(len(self.points_coords)):
            self.point_animations.append(
                Animation(self.spr_sheet, (125, 20), (20, 20), (1, 1)))
        counter = 0
        for elem in self.points_coords:
            self.points.append(
                Point(elem[0], elem[1], self.point_animations[counter]))
            counter += 1

        self.mus = Music()
        # Анимации приведений и сами приведения
        self.animation2 = Animation(self.spr_sheet, (925, 727), (80, 101),
                                    (1, 2))
        self.animation3 = Animation(self.spr_sheet, (925, 18), (80, 101),
                                    (1, 2))
        self.animation4 = Animation(self.spr_sheet, (533, 121), (80, 101),
                                    (1, 2))
        self.animation5 = Animation(self.spr_sheet, (840, 120), (80, 101),
                                    (1, 2))

        self.blue_ghost = Ghost(self.animation4, 220, 310)
        self.pink_ghost = Ghost(self.animation3, 200, 310)
        self.red_ghost = Ghost(self.animation2, 200, 260)
        self.orange_ghost = Ghost(self.animation5, 240, 310)
        self.ghost_list = [
            self.red_ghost, self.pink_ghost, self.blue_ghost, self.orange_ghost
        ]
        self.open_clock = pygame.time.Clock()
        self.delta_time = 0