Ejemplo n.º 1
0
def move_ball():
    for b in all_ball:
        x = sprite.get_sprite_x(b)
        y = sprite.get_sprite_y(b)
        sprite.move_sprite_to(b, x, y + 10)
        v = print(sprite.get_sprite_y(b))
        if v == 600:
            print('dimon! yletel')
Ejemplo n.º 2
0
def beskonechnoe_dvijenie_karika():
    global scorost
    for ball in balls:
        sprite.move_sprite_by(ball["number"], ball["scorostx"], ball["scorost"])
        ball["scorost"] += 1
        # print(ball["scorost"])
        # отбивка от низа
        niz = sprite.get_bottom(ball["number"])
        if niz >= 600:
            sprite.set_bottom_to(ball["number"], 600)
            ball["scorost"] = - ball["scorost"] * 0.9
            # if scorost < 9:
            if ball["scorost"] > -20:
                ball["scorost"] = - 20
            #     ball["scorost"]=-20
            print(ball["scorost"])
        # отбивка от правой границы
        right = sprite.get_right(ball["number"])
        if right >= 600:
            sprite.set_right_to(ball["number"], 600)
            ball["scorostx"] = - ball["scorostx"]

        left = sprite.get_left(ball["number"])
        if left <= 0:
            sprite.set_left_to(ball["number"], 0)
            ball["scorostx"] = -ball["scorostx"]
        sprite.move_sprite_to(ball["ballhp"],sprite.get_sprite_x(ball["number"]),sprite.get_sprite_y(ball["number"]))
Ejemplo n.º 3
0
def mouse_move(pos):
    y = sprite.get_sprite_y(pushka_UwU)
    sprite.move_sprite_to(pushka_UwU, pos[0], y)
    left = sprite.get_left(pushka_UwU)
    right = sprite.get_right(pushka_UwU)
    if left <= 0:
        sprite.set_left_to(pushka_UwU, 0)
    if right >= 600:
        sprite.set_right_to(pushka_UwU, 600)
Ejemplo n.º 4
0
def shof_bullet():
    for a in all_bullet:
        x = sprite.get_sprite_x(a)
        y = sprite.get_sprite_y(a) - 10
        sprite.move_sprite_to(a, x, y)
Ejemplo n.º 5
0
def add_bullet():
    bullet = sprite.add_sprite('bullet', sprite.get_sprite_x(pushka),
                               sprite.get_sprite_y(pushka))
    all_bullet.append(bullet)
Ejemplo n.º 6
0
world.set_world_background_color_rgb(27, 195, 255)

spot1 = sprite.add_sprite("pacman",
                          randint(1, 600),
                          randint(1, 600),
                          costume="dot")
spot2 = sprite.add_sprite("pacman",
                          x=randint(1, 600),
                          y=randint(1, 600),
                          costume="dot")

hero = sprite.add_sprite("pacman", 300, 300, costume="player2")

sprite.change_sprite_size_proc(hero, 110, 110)
sprite_actions.rotate_to_point(hero, 1000, sprite.get_sprite_x(spot1),
                               sprite.get_sprite_y(spot1))
sprite_actions.move_sprite_to(hero, 1000, sprite.get_sprite_x(spot1),
                              sprite.get_sprite_y(spot1))
sprite.hide_sprite(spot1)
sprite.change_sprite_size_proc(hero, 130, 130)

sprite_actions.rotate_to_point(hero, 1000, sprite.get_sprite_x(spot2),
                               sprite.get_sprite_y(spot2))
sprite_actions.move_sprite_to(hero, 1000, sprite.get_sprite_x(spot2),
                              sprite.get_sprite_y(spot2))
sprite.hide_sprite(spot2)
sprite.change_sprite_size_proc(hero, 150, 150)

enemy = sprite.add_sprite("pacman",
                          sprite.get_right(hero) + 10,
                          sprite.get_top(hero) - 10,