|
|
@@ -9,20 +9,37 @@ def on_mouse_down(): # fonction 'click avec souris' |
|
|
|
if on_mouse_down : |
|
|
|
titi.y =0 |
|
|
|
titi.speed = 0 |
|
|
|
|
|
|
|
piou.y =0 |
|
|
|
piou.speed = 0 |
|
|
|
|
|
|
|
def on_mouse_up(): # fonction 'quand la souris ne click plus' |
|
|
|
print('relache souris') |
|
|
|
if on_mouse_up : |
|
|
|
titi.y += 100 |
|
|
|
titi.speed = 5 |
|
|
|
piou.speed = 3 |
|
|
|
|
|
|
|
def update(): |
|
|
|
titi.y += titi.speed # mise a jour (60x/sec) de titi |
|
|
|
piou.y += piou.speed |
|
|
|
|
|
|
|
def draw(): |
|
|
|
screen.blit('background', (0, 0)) # import arrière plan |
|
|
|
titi.draw() # 'dessiner' titi |
|
|
|
piou.draw() |
|
|
|
|
|
|
|
|
|
|
|
titi = Actor('bird1', (75, 350)) # définir position de titi |
|
|
|
piou = Actor('bird2', (65,300)) |
|
|
|
titi.speed = 5 # définir vitesses de chute de titi |
|
|
|
pgzrun.go() # syntaxe 'conventionnelle' de pgzero |
|
|
|
piou.speed = 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pgzrun.go() # syntaxe 'conventionnelle' de pgzero |
|
|
|
|
|
|
|
|
|
|
|
|