Преглед на файлове

ajout reco clic droite ou gauche

chapitre-1-challenge-supp-correction-prof
Christophe Vandenabeele преди 3 години
родител
ревизия
4fc4f1c0d5
променени са 1 файла, в които са добавени 12 реда и са изтрити 9 реда
  1. +12
    -9
      birdie.py

+ 12
- 9
birdie.py Целия файл

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

Зареждане…
Отказ
Запис