Ejemplo n.º 1
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)
Ejemplo n.º 2
0
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)
Ejemplo n.º 3
0
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)
Ejemplo n.º 4
0
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)
Ejemplo n.º 5
0
Archivo: y.py Proyecto: Norik123/AAA
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)
Ejemplo n.º 6
0
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)