|
- import pgzrun
-
- TITLE = "Paf l'oiseau"
- WIDTH = 400
- HEIGHT = 708
-
- def on_mouse_down():
- print('Clic souris !')
- titi.y -= 50
-
- def update():
- titi.y += titi.speed
- tube_superieur.x -= vitesse_defilement
- tube_inferieur.x -= vitesse_defilement
- if tube_superieur.x + tube_superieur.width/2< 0 :
- tube_superieur.x = WIDTH + tube_superieur.width/2
- tube_inferieur.x = WIDTH + tube_superieur.width/2
-
- def draw():
- screen.blit('background', (0, 0))
- titi.draw()
- tube_superieur.draw()
- tube_inferieur.draw()
-
- titi = Actor('bird1', (75, 350))
- titi.speed = 1
- ecart = 140
- tube_superieur = Actor('top', (300, 0))
- tube_inferieur = Actor('bottom', (300, tube_superieur.height + ecart))
- vitesse_defilement = 1
-
- # print(tube_superieur.width, tube_superieur.height)
-
- pgzrun.go()
|