|
@@ -3,7 +3,7 @@ import pgzrun |
|
|
|
|
|
|
|
|
TITLE = "Paf l'oiseau" |
|
|
TITLE = "Paf l'oiseau" |
|
|
WIDTH = 400 |
|
|
WIDTH = 400 |
|
|
HEIGHT = 762 |
|
|
|
|
|
|
|
|
HEIGHT = 708 |
|
|
def on_mouse_down(): |
|
|
def on_mouse_down(): |
|
|
print('Clic souris !') |
|
|
print('Clic souris !') |
|
|
titi.y -= 50 # deplacement horizontal |
|
|
titi.y -= 50 # deplacement horizontal |
|
@@ -21,6 +21,12 @@ def update(): |
|
|
titi.y += titi.speed |
|
|
titi.y += titi.speed |
|
|
#titi.x += tit.speed fera deplacer lateralement |
|
|
#titi.x += tit.speed fera deplacer lateralement |
|
|
#si on modifie le 1 on augmente la vitesse de la chute |
|
|
#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 |
|
|
titi.speed = 1 |
|
|
|
|
|
|
|
|
pgzrun.go() |
|
|
pgzrun.go() |