Browse Source

chap3-start

chap3-start
ophelie 3 years ago
parent
commit
866605b3af
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      birdie.py

+ 10
- 1
birdie.py View File

@@ -6,7 +6,14 @@ HEIGHT = 708

def on_mouse_down():
print('Clic souris !')
titi.y -= 50
titi.speed = -6.5

def reset():
print("Retour au départ...")
titi.speed = 1
titi.center = (75, 350)
tube_superieur.center = (300, 0)
tube_inferieur.center = (300, tube_superieur.height + ecart)

def update():
titi.y += titi.speed
@@ -15,6 +22,8 @@ def update():
if tube_superieur.right < 0 :
tube_superieur.left = WIDTH
tube_inferieur.left = WIDTH
if titi.y > HEIGHT or titi.y < HEIGHT :
reset()

def draw():
screen.blit('background', (0, 0))


Loading…
Cancel
Save