Un petit jeu réalisé avec pgzero
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

43 řádky
653 B

  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. titi = Actor('bird1', (151, 350))
  6. titi2 = Actor('bird1', (11, 250))
  7. def draw():
  8. screen.blit('cascade', (0, 0))
  9. titi.draw()
  10. titi2.draw()
  11. def on_mouse_down():
  12. print('Clic souris !')
  13. titi.speed += 1
  14. titi2.speed += 1
  15. def on_mouse_up():
  16. titi.speed += 1
  17. titi2.speed += 2
  18. def update():
  19. if titi.x>400:
  20. titi.x = 0
  21. titi.x += titi.speed
  22. else:
  23. titi.x += titi.speed
  24. if titi2.x>400:
  25. titi2.x = 0
  26. titi2.x += titi2.speed
  27. else:
  28. titi2.x += titi.speed
  29. titi.speed = 1
  30. titi2.speed = 1
  31. pgzrun.go()