|
1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- import pgzrun
-
- TITLE = "Paf l'oiseau"
- WIDTH = 400
- HEIGHT = 708
-
- fond = Actor('background', (200,350))
- fond2 = Actor('background', (-200,350))
-
- def on_mouse_down():
- print('Clic souris !')
- titi.y -= 50
-
- def update():
- fond.x += 2
- fond2.x +=2
- if fond.x > 400 :
- fond.x = 200
- if fond2.x > 200 :
- fond2.x = 0
- 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():
- fond.draw()
- fond2.draw()
- 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()
|