Un petit jeu réalisé avec pgzero
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

37 lignes
691 B

  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. direction = 1
  6. def on_mouse_down(button):
  7. if button == mouse.LEFT:
  8. print('freinage')
  9. titi.speed -= 1
  10. elif button == mouse.RIGHT:
  11. print('accélaration')
  12. titi.speed += 1
  13. def on_mouse_up():
  14. titi.speed = 1
  15. blackbird.speed = 1
  16. def update():
  17. if titi.left > WIDTH:
  18. titi.right = 0
  19. if titi.right < 0:
  20. titi.left = WIDTH
  21. titi.x += titi.speed
  22. def draw():
  23. screen.blit('background', (0, 0))
  24. titi.draw()
  25. blackbird.draw()
  26. titi = Actor('bird1', (75, 350))
  27. blackbird = Actor('bird2', (95, 150))
  28. titi.speed = 1
  29. blackbird.speed = 2
  30. pgzrun.go()