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 886 B

il y a 3 ans
il y a 3 ans
il y a 3 ans
12345678910111213141516171819202122232425262728293031323334353637
  1. import pgzrun
  2. TITLE = "Paf l'oiseau"
  3. WIDTH = 400
  4. HEIGHT = 762
  5. # deplacement latéral
  6. def on_mouse_down():
  7. print('Clic souris !')
  8. titi.y -= 50 # deplacement horizontal
  9. titi.x += 25 # deplacement latéral
  10. grominet.y -= 50 # deplacement horizontal
  11. grominet.x += 40 # deplacement latéral
  12. # cela correspond au deplacement de titi du bas vers le haut
  13. def draw():
  14. screen.blit('cascade', (0, 0))
  15. titi.draw()
  16. grominet.draw()
  17. #titi = Actor('bird1', (70, 40))
  18. titi = Actor('titi', (200, 60))
  19. grominet = Actor('grominet', (70, 40))
  20. #(70, 350) le premier chiffre position de depart sur axe x
  21. # le deuxieme chiffre position axe y
  22. def update():
  23. titi.y += titi.speed
  24. grominet.y += grominet.speed
  25. #titi.x += tit.speed fera deplacer lateralement
  26. #si on modifie le 1 on augmente la vitesse de la chute
  27. titi.speed = 1
  28. grominet.speed = 1
  29. pgzrun.go()