diff --git a/birdie.py b/birdie.py index b737cf0..1986b59 100644 --- a/birdie.py +++ b/birdie.py @@ -3,7 +3,7 @@ import pgzrun TITLE = "Paf l'oiseau" WIDTH = 400 -HEIGHT = 762 +HEIGHT = 708 def on_mouse_down(): print('Clic souris !') titi.y -= 50 # deplacement horizontal @@ -21,6 +21,12 @@ def update(): titi.y += titi.speed #titi.x += tit.speed fera deplacer lateralement #si on modifie le 1 on augmente la vitesse de la chute + if titi.left > WIDTH : + titi.right = 0 + # titi left -> pgzrun interprete le calcul par rapport a image background + # et donc le fond de background est mis a 400 dans la variable width, + # ce qui donne que si la partie gauche de l'image titi est positionné a + # un niveau sup a la valeur de width, il se retrouve a un position 0 titi.speed = 1 pgzrun.go()