Un petit jeu réalisé avec pgzero
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

birdie.py 529 B

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
12345678910111213141516171819202122232425262728293031323334
  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. def on_mouse_down(button):
  6. if button == mouse.LEFT:
  7. print("freinage")
  8. titi.speed -=1
  9. elif button == mouse.RIGHT:
  10. print ("Accélération")
  11. titi.speed += 1
  12. def update():
  13. if titi.left > WIDTH:
  14. titi.right = 0
  15. if titi.right <0:
  16. titi.left = WIDTH
  17. titi.y += titi.speed
  18. def draw():
  19. screen.blit('background', (0, 0))
  20. titi.draw()
  21. titi = Actor ('bird1', (100,10))
  22. titi.speed = 1
  23. pgzrun.go()