exo birdie et titi de Greg
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.

titi_grominet.py 1.6 KiB

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
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
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 708
  5. # deplacement latéral
  6. def on_mouse_down(button):
  7. print('Clic souris !')
  8. print (button)
  9. if mouse.LEFT is button :
  10. titi.y -= 0 # deplacement horizontal
  11. titi.x += 25 # deplacement latéral
  12. grominet.y -= 0 # deplacement horizontal
  13. grominet.x += 40 # deplacement latéral
  14. if mouse.RIGHT is button :
  15. titi.y += 0 # deplacement horizontal
  16. titi.x -= 25 # deplacement latéral
  17. grominet.y += 0 # deplacement horizontal
  18. grominet.x -= 40 # deplacement latéral
  19. # cela correspond au deplacement de titi du bas vers le haut
  20. def draw():
  21. screen.blit('meme', (0, 0))
  22. titi.draw()
  23. grominet.draw()
  24. #titi = Actor('bird1', (70, 40))
  25. titi = Actor('titi', (200, 60))
  26. grominet = Actor('grominet', (70, 40))
  27. #(70, 350) le premier chiffre position de depart sur axe x
  28. # le deuxieme chiffre position axe y
  29. def update():
  30. titi.y += titi.speed
  31. grominet.y += grominet.speed
  32. #titi.x += tit.speed fera deplacer lateralement
  33. #si on modifie le 1 on augmente la vitesse de la chute
  34. # modif si tombe en bas, doit reapparaitre en haut
  35. if titi.top > HEIGHT :
  36. titi.bottom = 0
  37. if titi.bottom > HEIGHT :
  38. titi.top = 400
  39. if grominet.top > HEIGHT :
  40. grominet.bottom = 0
  41. if grominet.bottom > HEIGHT :
  42. grominet.top = 400
  43. if grominet.left > WIDTH :
  44. grominet.right = 0
  45. if grominet.right > WIDTH :
  46. grominet.left = 700
  47. if titi.left > WIDTH :
  48. titi.right = 0
  49. if titi.right > WIDTH :
  50. titi.left = 0
  51. titi.speed = 1
  52. grominet.speed = 1
  53. pgzrun.go()