Browse Source

chap1_challenge5

chapitre1-challenge-5
ophelie 3 years ago
parent
commit
4a1a638b41
1 changed files with 9 additions and 2 deletions
  1. +9
    -2
      birdie.py

+ 9
- 2
birdie.py View File

@@ -21,13 +21,20 @@ def on_mouse_up(): # fonction 'quand la souris ne click plus'
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
birdi.speed = 2
titi = Actor('bird1', (75, 350)) # définir position de titi
titi.speed = 5 # définir vitesses de chute de titi
titi.speed = 3 # définir vitesses de chute de titi

if titi.x > 400 and birdy.x > 400:
titi.x = 2
birdi.x = 4

pgzrun.go() # syntaxe 'conventionnelle' de pgzero

Loading…
Cancel
Save