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.

46 lignes
724 B

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