Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.

44 wiersze
736 B

  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 918
  4. HEIGHT = 1024
  5. titi = Actor('bird1',(100,200))
  6. piaf = Actor('bird1',(150,250))
  7. titi.speed = 1
  8. piaf.speed = 2
  9. def draw():
  10. screen.blit('rory',(0,0))
  11. titi.draw()
  12. piaf.draw()
  13. def update():
  14. titi.y+=titi.speed
  15. piaf.x+=piaf.speed
  16. if titi.top >= HEIGHT:
  17. titi.bottom = 0
  18. if piaf.left >= WIDTH:
  19. piaf.right = 0
  20. def on_mouse_down(button):
  21. if button == mouse.LEFT:
  22. print('Accélération!')
  23. titi.speed+=1
  24. piaf.speed+=2
  25. elif button == mouse.RIGHT:
  26. print('Freinage!')
  27. titi.speed-=2
  28. piaf.speed-=4
  29. def on_mouse_up():
  30. print('clicsouris!')
  31. titi.speed = 1
  32. piaf.speed = 2
  33. pgzrun.go()