예제 #1
0
def ekran_nastroek():
    skrit_gl_ekran()
    world.set_world_background_image(
        "C:/Users/zhuko/wrap_py_catalog/backgrounds/pixel.png")
    world.set_world_background_color([88, 88, 88])
    sprite.show_sprite(OK)
    sprite.move_sprite_to(OK, 350, 625)
예제 #2
0
def flight():
    # if bullet is not None:
    #     x,y=sprite.get_sprite_pos(bullet)
    #     sprite.move_sprite_to(bullet,x,y-5)
    for bullet in bullets:
        x, y = sprite.get_sprite_pos(bullet)
        sprite.move_sprite_to(bullet, x, y - 20)
예제 #3
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"]))
예제 #4
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')
예제 #5
0
def mouse(pos):
    sprite.move_sprite_to(pushka, pos[0], 600)
    leftyshka = sprite.get_left(pushka)
    rightyshka = sprite.get_right(pushka)
    if leftyshka < 0:
        sprite.set_left_to(pushka, 0)
    elif rightyshka > 700:
        sprite.set_right_to(pushka, 700)
예제 #6
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)
예제 #7
0
import wrap_py
from time import sleep
from wrap_py import world, sprite
from wrap_py import sprite_actions
world.create_world(600, 600)
sprite.add_sprite("blue_man", 200, 400)
sleep(3)
sprite.move_sprite_to(0, 400, 400)
sprite.set_sprite_flipx_reverse(0, True)
sprite_actions.move_sprite_to(0, 5000, 400, 200)
sprite.set_sprite_flipx_reverse(0, False)
예제 #8
0
파일: q.py 프로젝트: Norik123/AAA
                             monstery,
                             costume="enemy_blue_down1")

x1 = int(input("Введите размер первого монстра(размер в процентах) ?"))
y1 = int(input("Введите размер первого монстра(размер в процентах) ?"))

sprite.change_sprite_size_proc(monster1, x1, y1)
sleep(1)

monster2 = sprite.add_sprite("pacman",
                             monsterx,
                             monstery - 30,
                             costume="enemy_red_down1")
sprite.change_sprite_size_proc(monster2, x1 / 2, y1 / 2)
sprite.move_sprite_to(
    monster2, monsterx,
    sprite.get_top(monster1) - (sprite.get_sprite_height(monster2) / 2))
sleep(1)

monster3 = sprite.add_sprite("pacman",
                             monsterx,
                             monstery + 60,
                             costume="enemy_yellow_down1")
sprite.change_sprite_size_proc(monster3, x1 * 2, y1 * 2)
sprite.move_sprite_to(
    monster3, monsterx,
    sprite.get_bottom(monster1) + (sprite.get_sprite_height(monster3) / 2))
sleep(1)

packman = sprite.add_sprite("pacman",
                            monsterx - 100,
예제 #9
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)
예제 #10
0
def dvigat_ruku():
    skorost = 0
    ruka_x = sprite.get_sprite_x(ruka)
    sprite.move_sprite_to(ruka, skorost + ruka_x, 450)
    if ruka_x > 480:
        print("opasnost")