From 246a0db1d31846cf6852a6d5d8beea8f58d5484a Mon Sep 17 00:00:00 2001 From: ophelie Date: Tue, 1 Dec 2020 15:51:09 +0100 Subject: [PATCH] chap1_challenge4 --- birdie.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/birdie.py b/birdie.py index 58a55c2..169e6a6 100644 --- a/birdie.py +++ b/birdie.py @@ -6,23 +6,28 @@ HEIGHT = 708 #hauteur def on_mouse_down(): # fonction 'click avec souris' print('Clique souris !') # sortie en terminal pour verifier si c'est ok - if on_mouse_down : - titi.y =0 - titi.speed = 0 + titi.y += 4 + titi.speed = 0 + birdi.y +=6 + birdi.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 + titi.y += 6 + titi.speed = 5 + birdi.y += 10 + birdi.speed = 8 def update(): titi.y += titi.speed # mise a jour (60x/sec) de titi - + birdi.y += birdi.speed def draw(): screen.blit('background', (0, 0)) # import arrière plan titi.draw() # 'dessiner' titi + birdi.draw() +birdi = Actor("bird2", (50, 250)) +birdi.speed = 8 titi = Actor('bird1', (75, 350)) # définir position de titi titi.speed = 5 # définir vitesses de chute de titi pgzrun.go() # syntaxe 'conventionnelle' de pgzero \ No newline at end of file