Quellcode durchsuchen

ajout reco clic droite ou gauche

chapitre-1-challenge-supp-correction-prof
Ursprung
Commit
4fc4f1c0d5
1 geänderte Dateien mit 12 neuen und 9 gelöschten Zeilen
  1. +12
    -9
      birdie.py

+ 12
- 9
birdie.py Datei anzeigen

@@ -4,23 +4,26 @@ TITLE = "Paf l'oiseau"
WIDTH = 400
HEIGHT = 708

def on_mouse_down():
print('Clic souris !')
titi.x -= 50
titi2.x -= 50

def on_mouse_down(button):
if button == mouse.LEFT:
print('Freinage')
titi.vitesse -= 1
elif button == mouse.RIGHT :
print('Accelération')
titi.vitesse += 1
def update():
if titi.left > WIDTH:
titi.right = 0
if titi.right < 0:
titi.left = WIDTH
titi.x += titi.vitesse
titi2.x += titi2.vitesse

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

titi = Actor('bird1', (75, 350))
titi2 = Actor('bird0', (65,300))
titi.vitesse = 1
titi2.vitesse = 2

pgzrun.go()

Laden…
Abbrechen
Speichern