Un petit jeu réalisé avec pgzero
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
522 B

  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. titi = Actor('bird1', (75, 350))
  6. ghost = Actor('birddead',(75,350))
  7. def draw():
  8. screen.blit('background', (0, 0))
  9. titi.draw()
  10. ghost.draw()
  11. def on_mouse_down():
  12. print('stop !')
  13. titi.y -= 20
  14. ghost.x -= 10
  15. titi.speed = 0
  16. ghost.speed = 0
  17. def on_mouse_up():
  18. print('go')
  19. titi.speed = 5
  20. ghost.speed = 4
  21. def update():
  22. titi.x += titi.speed
  23. ghost.y += ghost.speed
  24. titi.speed = 5
  25. ghost.speed = 4
  26. pgzrun.go()