def update(): for object_ in objects_of_ship_2: g.moveObjectBy(object_, dx, 0) for object_ in cloud1: g.moveObjectBy(object_, dx / 3, 0) for object_ in cloud2: g.moveObjectBy(object_, dx * 2, 0) for object_ in cloud3: g.moveObjectBy(object_, dx * 1.5, 0) g.penColor('white') g.brushColor('white') g.rectangle(0, 0, frame_thickness, window_height) g.rectangle(window_width - frame_thickness, 0, window_width, window_height) if g.xCoord(stern_of_ship) > window_width: for object_ in objects_of_ship_2: g.moveObjectBy(object_, - window_width - ship_length, 0) if g.xCoord(cloud2[0]) > window_width: for object_ in cloud2: g.moveObjectBy(object_, - window_width - ship_length, 0) if g.xCoord(cloud1[0]) > window_width: for object_ in cloud1: g.moveObjectBy(object_, - window_width - ship_length, 0) if g.xCoord(cloud3[0]) > window_width: for object_ in cloud3: g.moveObjectBy(object_, - window_width - ship_length, 0)
def update_inner_eye(): g.moveObjectBy(circle_help_object, 1, 0) g.moveObjectTo(inner_eye_1, s_circle[2 * int(g.xCoord(circle_help_object))], s_circle[2 * int(g.xCoord(circle_help_object)) - 1]) if g.xCoord(circle_help_object) >= 79: g.moveObjectBy(circle_help_object, -79, 0)
def update_eye_2(): g.moveObjectBy(help_obj_eye_2, 1, 0) g.moveObjectBy(eye_2, 5 / z, 5 / z) if g.xCoord(eye_2) >= 625 / z: g.moveObjectBy(eye_2, -20 / z, -20 / z) g.changeFillColor(eye_2, colors[g.xCoord(help_obj_eye_2)]) if g.xCoord(help_obj_eye_2) >= 6: g.moveObjectBy(help_obj_eye_2, -6, 0)
def update(): for i in obj1: graph.moveObjectBy(i, 5, 0) for j in obj2: graph.moveObjectBy(j, 5, 0) if graph.xCoord(obj1[0]) >= 1000: for i in obj1: graph.moveObjectBy(i, -1100, 0) if graph.xCoord(obj2[0]) >= 1000: for i in obj2: graph.moveObjectBy(i, -1100, 0)
def eyes_move(): global flag_eyes if flag_eyes: graph.moveObjectBy(left_pupil, 0.1, 0) graph.moveObjectBy(right_pupil, 0.1, 0) if graph.xCoord(right_pupil) > 154: flag_eyes = False elif not flag_eyes: graph.moveObjectBy(left_pupil, -0.1, 0) graph.moveObjectBy(right_pupil, -0.1, 0) if graph.xCoord(right_pupil) < 128: flag_eyes = True
def update(): moveObjectBy(a, 1, 1) moveObjectBy(c, 1, 1) moveObjectBy(s, 1, 1) changeFillColor(a, randColor()) if xCoord(a) >= 500: close()
def updateman(): global dx, dy x = g.xCoord(body) + 75 y = g.yCoord(body) + 200 a = crosstheborder(x, y, 0, 15, 250, 500) dx = a[0] dy = a[1] moveobs([body, head, rhand, lhand, mouth, leye, reye], dx, dy)
def update_bow_tie(): global side angle = g.xCoord(bow_help) a_mult = math.cos(math.pi * (1 / 3 - angle / 36)) b_mult = math.sin(math.pi * (1 / 3 - angle / 36)) c_mult = math.cos(math.pi * (1 / 3 + angle / 36)) d_mult = math.sin(math.pi * (1 / 3 + angle / 36)) g.brushColor('black') g.polygon([(600 / z, 850 / z), (600 / z + side * a_mult / z, 850 / z - side * b_mult / z), (600 / z + side * c_mult / z, 850 / z + side * d_mult / z), (600 / z, 850 / z), (600 / z - side * c_mult / z, 850 / z - side * d_mult / z), (600 / z - side * a_mult / z, 850 / z + side * b_mult / z), (600 / z, 850 / z)]) g.moveObjectBy(bow_help, 1, 0) if g.xCoord(bow_help) >= 72: g.moveObjectBy(bow_help, -72, 0)
def updateeyes(): global ex, ey xl = g.xCoord(leye) xr = xl + 20 xh, yh = g.center(head) if xl < xh - 30: ex = 10 elif xr > xh + 10: ex = -10 g.moveObjectBy(leye, ex, ey) g.moveObjectBy(reye, ex, ey)
def update_mouth(): step = g.xCoord(mouth_help) global m m = 1 / (step + 2) g.brushColor('red') g.polygon([(600 / z, 500 / z + 150 / z), (600 / z + 150 * m / z, 500 / z + 60 / z), (600 / z - 150 * m / z, 500 / z + 60 / z), (600 / z, 500 / z + 150 / z)]) step += 1 if step >= 7: g.moveObjectBy(mouth_help, -7, 0)
def update(): for dot in objects.dots: if objects.brusochek.p != 0: dot.circleInWindow() objects.cirleMov() objects.mklable() if dot.getPosition('y') + dot.radius( ) >= height + radius: # условие проигрыша graph.close() else: # фиксация шарика над платформой graph.moveObjectTo( dot.object, objects.brusochek.position_update() + objects.brusochek.width / 2, dot.getPosition('y') - dot.radius()) dot.setPosition(graph.xCoord(dot.object), objects.brusochek.y - dot.radius() * 4)
def change_color(): g.moveObjectBy(help_obj, 10, 0) letters(g.xCoord(help_obj), g.xCoord(help_obj), g.xCoord(help_obj)) if g.xCoord(help_obj) >= 200: g.moveObjectBy(help_obj, -200, 0)
def update_eye_1(): g.moveObjectBy(help_obj_eye_1, 1, 0) g.changeFillColor(eye_1, colors[g.xCoord(help_obj_eye_1)]) if g.xCoord(help_obj_eye_1) >= 6: g.moveObjectBy(help_obj_eye_1, -6, 0)
def movement(): for num in range(0, 16): if num == 0: if graph.xCoord(a[0]) != 295: graph.moveObjectBy(a[0], 1, 0) else: graph.moveObjectBy(a[0], -5, 0) if num == 1: if graph.xCoord(a[1]) != 285: graph.moveObjectBy(a[1], -1, 0) else: graph.moveObjectBy(a[1], 5, 0) if num == 2: if graph.xCoord(a[2]) != 288: graph.moveObjectBy(a[2], 1, 0) else: graph.moveObjectBy(a[2], -5, 0) if num == 3: if graph.xCoord(a[3]) != 273: graph.moveObjectBy(a[3], -1, 0) else: graph.moveObjectBy(a[3], 5, 0) if num == 4: if graph.xCoord(a[4]) != 277: graph.moveObjectBy(a[4], 1, 0) else: graph.moveObjectBy(a[4], -5, 0) if num == 5: if graph.xCoord(a[5]) != 256: graph.moveObjectBy(a[5], -1, 0) else: graph.moveObjectBy(a[5], 5, 0) if num == 6: if graph.xCoord(a[6]) != 256: graph.moveObjectBy(a[6], 1, 0) else: graph.moveObjectBy(a[6], -5, 0) if num == 7: if graph.xCoord(a[7]) != 251: graph.moveObjectBy(a[7], -1, 0) else: graph.moveObjectBy(a[7], 4, 0) if num == 8: if graph.xCoord(a[8]) != 256: graph.moveObjectBy(a[8], 1, 0) else: graph.moveObjectBy(a[8], -1, 0) if num == 9: if graph.xCoord(a[9]) != 250: graph.moveObjectBy(a[9], -1, 0) else: graph.moveObjectBy(a[9], 5, 0) if num == 10: if graph.xCoord(a[10]) != 270: graph.moveObjectBy(a[10], 1, 0) else: graph.moveObjectBy(a[10], -5, 0) if num == 12: if graph.xCoord(a[12]) < 285: graph.moveObjectBy(a[12], 1, 0) else: graph.moveObjectBy(a[12], -5, 0) if num == 13: if graph.xCoord(a[13]) < 290: graph.moveObjectBy(a[13], 1, 0) else: graph.moveObjectBy(a[13], -5, 0) if num == 14: if graph.xCoord(a[14]) < 295: graph.moveObjectBy(a[14], 1, 0) else: graph.moveObjectBy(a[14], -5, 0) if num == 15: if graph.xCoord(a[15]) < 300: graph.moveObjectBy(a[15], 1, 0) else: graph.moveObjectBy(a[15], -5, 0)