Advertisement
rishabbansal21

Covid Fighter Part-1

Jun 4th, 2021
1,167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. from ursina import *
  2. import random
  3.  
  4. app = Ursina()
  5. shoot = False
  6.  
  7. def update():
  8.     global doctor, shoot
  9.  
  10.     if held_keys['right arrow']:
  11.         doctor.x += 0.007
  12.     if held_keys['left arrow']:
  13.         doctor.x -= 0.007
  14.  
  15.     if shoot:
  16.         vaccine.y += 0.015
  17.  
  18. def input(key):
  19.     global shoot
  20.  
  21.     if key == "space":
  22.         shoot = True
  23.  
  24. Entity(model="quad", scale=70, texture="back.jpg")
  25.  
  26. back_size = 22
  27. back = Entity(model='quad', color=color.rgba(255,255,255,0), scale=(12,18),
  28.               position=(back_size//2, back_size//2, -0.01))
  29.  
  30.  
  31. doctor = Entity(model="cube", parent=back, texture='doctor.png', scale=0.2,
  32.                 position=(0,-0.75,0))
  33.  
  34.  
  35. vaccine = Entity(model="quad", parent=back, texture='vaccine.png', scale=0.1,
  36.                  position=(0,-0.45))
  37.  
  38.  
  39. virus = Entity(model="quad", parent=back, texture='virus.png', scale=0.15,
  40.                position=(0,0))
  41.  
  42. camera.position = (back_size//2, -15, -11)
  43. camera.rotation_x = -60
  44. app.run()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement