Przeglądaj źródła

chap1-challenge4

chapitre-1-challenge-4
Jen 3 lat temu
rodzic
commit
2e0e262e11
2 zmienionych plików z 20 dodań i 2 usunięć
  1. +19
    -2
      birdie.py
  2. +1
    -0
      paf-loiseau

+ 19
- 2
birdie.py Wyświetl plik

@@ -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




+ 1
- 0
paf-loiseau

@@ -0,0 +1 @@
Subproject commit 73a5928bb30eac022e4e75d97302aa4aa8953dbd

Ładowanie…
Anuluj
Zapisz