Un petit jeu réalisé avec pgzero
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

44 satır
997 B

  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. fond = Actor('background', (200,350))
  6. fond2 = Actor('background', (-200,350))
  7. def on_mouse_down():
  8. print('Clic souris !')
  9. titi.y -= 50
  10. def update():
  11. fond.x += 2
  12. fond2.x +=2
  13. if fond.x > 400 :
  14. fond.x = 200
  15. if fond2.x > 200 :
  16. fond2.x = 0
  17. titi.y += titi.speed
  18. tube_superieur.x -= vitesse_defilement
  19. tube_inferieur.x -= vitesse_defilement
  20. if tube_superieur.x + tube_superieur.width/2< 0 :
  21. tube_superieur.x = WIDTH + tube_superieur.width/2
  22. tube_inferieur.x = WIDTH + tube_superieur.width/2
  23. def draw():
  24. fond.draw()
  25. fond2.draw()
  26. titi.draw()
  27. tube_superieur.draw()
  28. tube_inferieur.draw()
  29. titi = Actor('bird1', (75, 350))
  30. titi.speed = 1
  31. ecart = 140
  32. tube_superieur = Actor('top', (300, 0))
  33. tube_inferieur = Actor('bottom', (300, tube_superieur.height + ecart))
  34. vitesse_defilement = 1
  35. # print(tube_superieur.width, tube_superieur.height)
  36. pgzrun.go()