def shooting(): global bullet y = sprite.get_top(pushka_UwU) x = sprite.get_sprite_x(pushka_UwU) bullet = sprite.add_sprite("bullet", x, y) bullets.append(bullet) sprite.set_bottom_to(bullet, y)
import wrap_py.ru, random from wrap_py import sprite, sprite_actions, world from random import randint from time import sleep world_x = 500 world_y = 500 world.create_world(world_x, world_y) monsterx = randint(world_x / 2, world_x) monstery = world_y / 2 monster1 = sprite.add_sprite("pacman", monsterx, 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)
def add_ball(): ball = sprite.add_sprite('misc', 0, 0) all_ball.append(ball)
def add_bullet(): bullet = sprite.add_sprite('bullet', sprite.get_sprite_x(pushka), sprite.get_sprite_y(pushka)) all_bullet.append(bullet)
import wrap_py, wrap_py.ru, random from wrap_py import world from wrap_py import sprite world.create_world(700, 700) world.set_world_background_image( 'wrap_py_catalog/backgrounds/fon_gori1_700_800.png') pushka = sprite.add_sprite('blast_ball', 350, 600) ball = sprite.add_sprite('misc', 350, 350, costume='ny_ball') bullet = None all_bullet = [] all_ball = [] @wrap_py.on_mouse_move 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) @wrap_py.on_mouse_down() def add_bullet(): bullet = sprite.add_sprite('bullet', sprite.get_sprite_x(pushka), sprite.get_sprite_y(pushka)) all_bullet.append(bullet)
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")
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.ru, random from random import randint from time import sleep from wrap_py import sprite, sprite_actions, world world_x = 600 world_y = 600 world.create_world(world_x, world_y) monsterx = world_x / 2 monstery = world_y / 2 monster = sprite.add_sprite("pacman", monsterx, monstery, costume="enemy_blue_down1") sprite.change_sprite_size_proc(monster, 180, 180) x = int(input("Координаты X")) y = int(input("Координаты Y")) if x > 0 and y > 0: sprite.change_sprite_costume(monster, "enemy_blue_right1") sprite_actions.move_sprite_to(monster, 1500, monsterx + x, monstery) sprite.change_sprite_costume(monster, "enemy_blue_down1") sprite_actions.move_sprite_to(monster, 1500, monsterx + x, monstery + y) elif x > 0 and y < 0: sprite.change_sprite_costume(monster, "enemy_blue_right1") sprite_actions.move_sprite_to(monster, 1500, monsterx + x, monstery) sprite.change_sprite_costume(monster, "enemy_blue_up1") sprite_actions.move_sprite_to(monster, 1500, monsterx + x, monstery + y)
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, "Тоже все хорошо.Спасибо")
import wrap_py from time import sleep from wrap_py import world, sprite from wrap_py import sprite_actions world.create_world(1000, 600) # move_1=world.set_world_background_color_rgb(255,249,38) # predator=sprite.add_sprite("star_wars",80,500,True,"ship1") # 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)
import wrap_py as wrap, wrap_py.ru, random from wrap_py import sprite 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)
import wrap_py from wrap_py import sprite, sprite_actions, world wide = 1000 height = 150 island1 = 200 island2 = 300 world.create_world(wide, height) y1 = (height / 4) * 3 x1 = 32 sprite.add_sprite("mario-items", x1, y1, True, "moving_platform2") x2 = wide - 32 y2 = y1 - 40 sprite.add_sprite("mario-items", x2, y1, True, "moving_platform2") mario = sprite.add_sprite("mario-1-big", x1, y2, True, "stand") half_way = (x2 - x1) / 2 sprite_actions.move_sprite_to(mario, 1000, x1 + half_way, y2 - half_way) sprite_actions.move_sprite_to(mario, 1000, x2, y2)
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 from time import sleep 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") treasure_x = randint(1, world_x) treasure_y = randint(1, world_y) treasure1 = sprite.add_sprite("mario-items", treasure_x, treasure_y, visible=False, 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")
import wrap_py from wrap_py import sprite, sprite_actions, world from time import sleep world_x = 600 world_y = 700 world.create_world(world_x, world_y) world.set_world_background_color_rgb(223, 225, 255) x1 = 32 y1 = (world_y / 4) * 3 sprite.add_sprite("mario-items", x1, y1, True, "moving_platform2") x2 = (world_x / 8) * 3 y2 = y1 - 50 sprite.add_sprite("mario-items", x2, y2, True, "moving_platform2") x3 = (world_x / 8) * 5 y3 = y1 + 50 sprite.add_sprite("mario-items", x3, y3, True, "moving_platform2") x4 = world_x - 32 y4 = y1 - 200 sprite.add_sprite("mario-items", x4, y4, True, "moving_platform2") mario_x = 32 mario_y = y1 - 40 mario = sprite.add_sprite("mario-1-big", mario_x, mario_y, True, "stand") mario_way1 = (x2 - x1) / 2
import wrap_py.ru, random from random import randint from time import sleep 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("Куда идем?"))
import wrap_py.ru, random from wrap_py import sprite, sprite_actions, world from random import randint world.create_world(600, 600) 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)
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)
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)