Advertisement
Enrro

Solucion de un circulo que rebota 102127

Oct 21st, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.45 KB | None | 0 0
  1. '''
  2. Created on 21/10/2014
  3. circulos que se mueven
  4. @author: A01221672
  5. '''
  6. from Tkinter import*
  7. direction =1
  8. x=1
  9. ancho=400
  10. alto=375
  11. ventana = Tk()
  12. lienzo =Canvas(ventana, width= ancho, height=alto)
  13. lienzo.pack()
  14.  
  15. while True:
  16. lienzo.delete('all')
  17. lienzo.create_oval(x+10,40,x+100,100,fill = 'blue')
  18. if (x>300 or x <0):
  19. direction =direction*(-1)
  20. x+=10*direction
  21. lienzo.after(200)
  22. lienzo.update()
  23.  
  24.  
  25. mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement