from wrap_py import sprite, sprite_actions, world world_x = 500 world_y = 500 world.create_world(world_x, world_y) world.set_world_background_color_rgb(27, 195, 255) mario = sprite.add_sprite("mario-1-big", 80, 80, costume="stand") x1 = int(input("Куда идем?")) y1 = int(input("Куда идем?")) sprite_actions.move_sprite_to(mario, 1000, x1, y1) sprite.add_sprite("pacman", x1, y1, costume="dot") print("точка №1 ", x1, y1) sprite.add_text(x1, y1 - 8, "точка №1", font_size=12) x2 = int(input("Куда идем?")) y2 = int(input("Куда идем?")) sprite_actions.move_sprite_to(mario, 1000, x2, y2) sprite.add_sprite("pacman", x2, y2, costume="dot") print("точка №2 ", x2, y2) sprite.add_text(x2, y2 - 8, "точка №2", font_size=12) x3 = int(input("Куда идем?")) y3 = int(input("Куда идем?")) sprite_actions.move_sprite_to(mario, 1000, x3, y3) sprite.add_sprite("pacman", x3, y3, costume="dot") print("точка №3 ", x3, y3)
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, monstery, costume="player2") x2 = sprite.get_sprite_width(monster3) y2 = sprite.get_bottom(monster3) - sprite.get_top(monster2) sprite.change_sprite_size(packman, x2 / 2, y2 / 5) sprite.add_text(monsterx - 100, sprite.get_top(packman) - 20, "Аaaaaaaa", text_color=(255, 252, 24)) sleep(1) sprite.hide_sprite(4) # point = (monsterx - 100,monstery ) # sprite.calc_angle_by_point(monster1, point) # # sprite_actions.rotate_to_angle(monster1, 1000, sprite.set_final_angle) sprite_actions.rotate_to_point(monster2, 1000, monsterx - 100, monstery) sprite_actions.rotate_to_point(monster1, 1000, monsterx - 100, monstery) sprite_actions.rotate_to_point(monster3, 1000, monsterx - 100, monstery) sprite_actions.move_sprite_to(monster2, 1000, monsterx - 100, monstery) sprite_actions.move_sprite_to(monster1, 1000, monsterx - 100, monstery)
costume="pipe") sprite.change_sprite_size_proc(treasure1, 33, 33) dist = math.dist([80, 80], [treasure_x, treasure_y]) print(int(dist), "до клада") sprite_actions.rotate_to_point(mario, 1000, treasure_x, treasure_y) x1 = int(input("Куда идем?")) y1 = int(input("Куда идем?")) sprite_actions.move_sprite_to(mario, 1000, x1, y1) sprite.add_sprite("pacman", x1, y1, costume="dot") text1 = str(x1) text11 = str(y1) sprite.add_text(x1, y1 - 20, "x:" + text1 + " y:" + text11, font_size=12) sprite_actions.rotate_to_point(mario, 1000, treasure_x, treasure_y) result1 = sprite.sprites_collide(mario, treasure1) if result1: print("нашел") sprite.show_sprite(treasure1) exit() if not result1: print("не нашел") dist1 = math.dist([x1, y1], [treasure_x, treasure_y]) print(int(dist1), "до клада") x2 = int(input("Куда идем?"))
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, costume="enemy_red_down1") sprite.add_text(sprite.get_sprite_x(enemy), (sprite.get_sprite_y(enemy)) - 30, "Я тебя съем", font_size=13) sprite_actions.rotate_to_angle(hero, 1000, 215) sprite_actions.move_sprite_to_angle(hero, 1000, 300)
from time import sleep from wrap_py import sprite, world import wrap_py.ru wrap_py.world.create_world(500, 500) world.set_world_background_color_rgb(178, 58, 131) wrap_py.sprite.add_sprite("blue_man", 500, 100) sleep(3) sprite.add_sprite("star_wars", 10, 40) sprite.add_sprite("star_wars", 30, 20, 1, "ship3") sprite.add_text(70, 80, "Hello")
from time import sleep from wrap_py import sprite, world import wrap_py.ru world.create_world(630, 600) world.set_world_background_color_rgb(65, 255, 252) sleep(3) sprite.add_sprite("blue_man", 150, 450) sleep(3) sprite.add_sprite("rocket_man", 500, 430) sleep(2) sprite.add_text(150, 320, "Привет") sleep(2) sprite.add_text(500, 320, "Привет") sleep(3) sprite.add_text(150, 280, "Как дела ?") sleep(3) sprite.add_text(500, 280, "Хорошо)А у тебя как ?") sleep(4) sprite.add_text(150, 240, "Тоже все хорошо.Спасибо")
mario = sprite.add_sprite("mario-1-big", mario_x, mario_y, True, "stand") mario_way1 = (x2 - x1) / 2 sprite_actions.move_sprite_to(mario, 1000, mario_x + mario_way1, mario_y - mario_way1) sprite_actions.move_sprite_to(mario, 1000, x2, y2 - 40) mario_way2 = (x3 - x2) / 2 sprite_actions.move_sprite_to(mario, 1000, x2 + mario_way2, (y2 - 40) - mario_way2) sprite_actions.move_sprite_to(mario, 1000, x3, y3 - 40) mario_way3 = (x4 - x3) / 2 sprite_actions.move_sprite_to(mario, 1000, x3 + mario_way3, (y3 - 40) - mario_way3) sprite_actions.move_sprite_to(mario, 1000, x4, y4 - 40) sprite.set_sprite_flipx_reverse(mario, True) words = sprite.add_text(x4 - 30, (y4 - 40) - 50, "Так,обратно") sleep(1) sprite.hide_sprite(words) mario_way4 = (x4 - x1) / 2 sprite_actions.move_sprite_to(mario, 1000, x4 - mario_way4, (y4 - 40) - mario_way4) sprite_actions.move_sprite_to(mario, 1000, mario_x, mario_y) words2 = sprite.add_text(mario_x + 20, mario_y - 50, "Ну вот") sleep(1) sprite.hide_sprite(words2)
# prey=sprite.add_sprite("star_wars",260,500,True,"x-wing"),sprite.rotate_to_angle(1,90) # a="Стой" # b="Неа" move_2 = world.set_world_background_color_rgb(32, 221, 255) predator = sprite.add_sprite("star_wars", 80, 500, True, "x-wing") sprite.rotate_to_angle(0, 90) prey = sprite.add_sprite("star_wars", 260, 500, True, "ship1") a = "Теперь я лечу за тобой" b = "АААААААААА" print(predator) print(prey) sleep(1) sprite.add_text(100, 420, a) sleep(1) sprite.hide_sprite(2) sleep(1) sprite.add_text(260, 420, b) sleep(1) sprite.hide_sprite(3) sleep(1) sprite_actions.move_sprite_to(1, 1000, 700, 500) sprite_actions.move_sprite_to(0, 1000, 530, 500) sprite_actions.rotate_to_angle(1, 1000, 45) sprite_actions.move_sprite_to_angle(1, 1000, 300) sprite_actions.rotate_to_angle(0, 1000, 65) sprite_actions.move_sprite_to_angle(0, 1000, 270) sprite_actions.rotate_to_angle(1, 1000, -45) sprite_actions.move_sprite_to_angle(1, 1000, 300)
from wrap_py import world world.create_world(700, 800) world.set_world_background_image( "C:/Users/zhuko/wrap_py_catalog/backgrounds/fon_gori1700-800.png") pushki = sprite.add_sprite("knopki", 40, 40, costume="pushki") nastroiki = sprite.add_sprite("knopki", 130, 40) zamochek = sprite.add_sprite("knopki", 285, 625, False, "zamochek") OK = sprite.add_sprite("knopki", 350, 625, False, "OK") ball_blast = sprite.add_sprite("ball_blast", 350, 200) pushka = sprite.add_sprite("pushka", 350, 400, False) ruka = sprite.add_sprite("ball_blast", 350, 450, costume="ruka") palka = sprite.add_sprite("ball_blast", 350, 400, costume="palka") najmi = sprite.add_text(350, 365, "нажми чтобы начать", font_size=25, bold=True) sprite.set_bottom_to(pushka, 668) sprite.show_sprite(pushka) @wrap_py.on_mouse_move def navedenie_na_knopki(pos): navedenie_na_knopku(pushki, pos) navedenie_na_knopku(nastroiki, pos) navedenie_na_knopku(OK, pos) navedenie_na_knopku(zamochek, pos) def navedenie_na_knopku(nomer_knopki, pos):
import wrap_py, wrap_py.ru from wrap_py import world, sprite world.create_world(600, 600) sprite.add_sprite("rocket_man", 300, 300, costume="rocket") world.set_world_background_color_rgb(180, 45, 255) pushka_UwU = sprite.add_sprite("X_X_pushka", 80, 600) sprite.set_bottom_to(pushka_UwU, 600) sprite.set_left_to(pushka_UwU, 0) ball = sprite.add_sprite("spring", 300, 0) ballhp = sprite.add_text(300, 0, "3",text_color=[255,255,255],font_size=25) scorost = 0 bullet = None bullets = [] balls = [] d = {"number": ball, "scorost": 0, "scorostx": 5, "ballhp": ballhp} balls.append(d) ball2 = sprite.add_sprite("spring", 200, 400) ballhp2=sprite.add_text(200,400,"5",text_color=[255,255,255],font_size=25) b = {"number": ball2, "scorost": 0, "scorostx": -8,"ballhp":ballhp2} balls.append(b) @wrap_py.always(50) 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"])
import wrap_py.ru, random, math from wrap_py import sprite, sprite_actions, world from random import randint, choice from time import sleep world.create_world(1000, 430) world.set_world_background_color_rgb(27, 195, 255) mario = sprite.add_sprite("mario-1-big", 450, 400, costume="stand") Home1 = sprite.add_sprite("mario-items", 200, 150, costume="pipe") sprite.add_text(200, 80, "1", font_size=50) Home2 = sprite.add_sprite("mario-items", 500, 150, costume="pipe") sprite.add_text(500, 80, "2", font_size=50) Home3 = sprite.add_sprite("mario-items", 800, 150, costume="pipe") sprite.add_text(800, 80, "3", font_size=50) FIRE = sprite.add_sprite("pacman", 320, 400, costume="enemy_red_down1") WATER = sprite.add_sprite("pacman", 360, 400, costume="enemy_blue_down1") MEAL = sprite.add_sprite("pacman", 400, 400, costume="enemy_yellow_down1") fire = random.choice(["дом №1", "дом №2", "дом №3"]) water = random.choice(["дом №1", "дом №2", "дом №3"]) meal = random.choice(["дом №1", "дом №2", "дом №3"]) if fire == "дом №1": sprite_actions.move_sprite_to(FIRE, 1000, 140, 150) if fire == "дом №2": sprite_actions.move_sprite_to(FIRE, 1000, 440, 150) if fire == "дом №3": sprite_actions.move_sprite_to(FIRE, 1000, 740, 150)
import wrap_py from time import sleep from wrap_py import world, sprite from wrap_py import sprite_actions world.set_world_background_color_rgb(108, 255, 45) world.create_world(900, 600) # hunter="blue_man" # victim="flappy_bird" # hunter_text="Птичка стой" hunter = "flappy_bird" victim = "blue_man" hunter_text = "Иди ты" sprite.add_sprite(hunter, 150, 400) sprite.add_sprite(victim, 400, 400) sprite.add_text(150, 430, hunter_text) sleep(2) sprite.hide_sprite(2) sprite_actions.move_sprite_to(1, 2000, 550, 400) sprite_actions.move_sprite_to(0, 200, 400, 400) sprite_actions.rotate_to_angle(1, 1000, 45) sprite_actions.move_sprite_to_angle(1, 2000, 100)