Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ursina import *
- import random
- app = Ursina()
- shoot = False
- v = 0
- def update():
- global doctor, shoot, vaccine_list, v
- if held_keys['right arrow']:
- doctor.x += 0.007
- if held_keys['left arrow']:
- doctor.x -= 0.007
- if shoot:
- vaccine_list[v].y += 0.015
- if vaccine_list[v].y > 0.2:
- destroy(vaccine_list[v])
- shoot = False
- for i in virus_list:
- i.y -= 0.001
- def input(key):
- global shoot, vaccine_list, v
- st = -0.8
- if key == "space":
- shoot = True
- v += 1
- vaccine_list.append(duplicate(vaccine, x=doctor.x, y=st))
- Entity(model="quad", scale=70, texture="back.jpg")
- back_size = 22
- back = Entity(model='quad', color=color.rgba(255,255,255,0), scale=(12,18),
- position=(back_size//2, back_size//2, -0.01))
- doctor = Entity(model="cube", parent=back, texture='doctor.png', scale=0.2,
- position=(0,-0.75,0))
- vaccine = Entity(model="quad", parent=back, texture='vaccine.png', scale=0.1,
- position=(2,2))
- vaccine_list = [duplicate(vaccine, y=2,x=2)]
- virus = Entity(model="quad", parent=back, texture='virus.png', scale=0.15,
- position=(2,2))
- virus_list = []
- for i in range(5):
- virus_list.append(duplicate(virus, x=random.randint(-45,45)/100, y=random.randint(-3,-1)/100))
- camera.position = (back_size//2, -15, -11)
- camera.rotation_x = -60
- app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement