ahmed0saber

Scaling a cube in Python

May 7th, 2021
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.22 KB | None | 0 0
  1. from ursina import *
  2.  
  3. def update():
  4.     global speed
  5.     cube.x+=time.dt*speed
  6.     if abs(cube.x)>3:
  7.         speed*=-1
  8.  
  9. app=Ursina()
  10. speed=1
  11. cube=Entity(model="cube",color=color.rgb(0,0,100),scale=(1,2,10))
  12. app.run()
Advertisement
Add Comment
Please, Sign In to add comment