|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- import pgzrun
-
- TITLE = "Paf l'oiseau"
- WIDTH = 400
- HEIGHT = 708
-
- def on_mouse_down(): # Quand on clic avec la souris
- print('Clic souris !')
- titi.y -= 1
- titi.x += 0
- titi.speed = 0
-
- tutu.y -= 0
- tutu.x += 1
- tutu.speed = 0
-
- def on_mouse_up(): # Quand on relache le bouton de la souris
- print("Souris Don't clic !")
- titi.x += 20
- titi.y -= 10
- titi.speed = 1
-
- tutu.x += 30
- tutu.y -= 5
- titi.speed = 1
-
- def update():
- titi.y += titi.speed
- if titi.left > WIDTH: # Si Titi gauche arrive à plus que la valeur WIDTH
- titi.right = 0 # il retourne à la position 0 de droite
-
- if tutu.left > WIDTH: # Si Tutu gauche arrive à plus que la valeur WIDTH
- tutu.right = 0 # il retourne à la position 0 de droite
-
- #if titi.bottom > HEIGHT: # Si Titi dépasse la profondeur de l'ecran
- #dead.go
- #dead.x += 1
- #dead.y -= 1
- #dead.speed += 1
-
- def draw():
- screen.blit('background', (0, 0)) # Défini le fond d'écran
- titi.draw()
- tutu.draw()
- #dead.draw()
-
- titi = Actor('bird1', (60, 0)) # Défini l'objet acteur Titi
- tutu = Actor('bird2', (70, 10)) #Défini l'objet acteur Tutu
- #dead = Actor('birddead', (200, 708)) # Défini l'objet acteur Dead
-
-
-
-
- titi.speed = 1
- tutu.speed = 1
- #dead.speed = 1
-
- pgzrun.go()
|