Sanjin1

Untitled

Sep 28th, 2021
908
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. from ursina import *
  2.  
  3. app = Ursina()
  4.  
  5. circle = Entity(model = 'circle', collider = 'box', color = color.pink, scale = 1, position = (0,3,0))
  6.  
  7. square = Entity(model = 'quad', collider = 'box', color = color.yellow, scale = (3,1), position = (0,2,0), dy = -0.01)
  8.  
  9. circle = Entity(model = 'circle', collider = 'box', color = color.pink, scale = 1, position = (0,-2,0))
  10.  
  11. def update():
  12.     square.y += square.dy
  13.    
  14.     hit_info = square.intersects()
  15.     if hit_info.hit:
  16.         square.dy = -square.dy
  17.  
  18. app.run()
RAW Paste Data