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.

birdiesV2.py 997 B

il y a 3 ans
1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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()