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.

birdie.py 1004 B

il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
il y a 3 ans
12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. def on_mouse_down():
  6. print('Clic souris !')
  7. titi.speed = -6.5
  8. def reset():
  9. print("Retour au départ...")
  10. titi.speed = 1
  11. titi.center = (75, 350)
  12. tube_superieur.center = (300, 0)
  13. tube_inferieur.center = (300, tube_superieur.height + ecart)
  14. def update():
  15. titi.y += titi.speed
  16. tube_superieur.x -= vitesse_defilement
  17. tube_inferieur.x -= vitesse_defilement
  18. if tube_superieur.right < 0 :
  19. tube_superieur.left = WIDTH
  20. tube_inferieur.left = WIDTH
  21. if titi.y > HEIGHT or titi.y < HEIGHT :
  22. reset()
  23. def draw():
  24. screen.blit('background', (0, 0))
  25. titi.draw()
  26. tube_superieur.draw()
  27. tube_inferieur.draw()
  28. titi = Actor('bird1', (75, 350))
  29. titi.speed = 1
  30. ecart = 140
  31. tube_superieur = Actor('top', (300, 0))
  32. tube_inferieur = Actor('bottom', (300, tube_superieur.height + ecart))
  33. vitesse_defilement = 1
  34. # print(tube_superieur.width, tube_superieur.height)
  35. pgzrun.go()