Przeglądaj źródła

ok

chapitre-2-start
Alain Somville 3 lat temu
rodzic
commit
e87b0fcdd0
1 zmienionych plików z 18 dodań i 2 usunięć
  1. +18
    -2
      birdie.py

+ 18
- 2
birdie.py Wyświetl plik

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


titi = Actor('bird1', (75, 350))
titi.speed = 1
ecart = 50
tube_superieur = Actor ('top', (300,0))
tube_inferieur = Actor ('bottom',(300,tube_superieur.height + ecart))

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

def update():
titi.y += titi.speed
tube_superieur.x -= vitesse_defilement
tube_inferieur.x -= vitesse_defilement*2
if tube_superieur.right < 0:
tube_superieur.left = WIDTH
if tube_inferieur.right < 0:
tube_inferieur.left = WIDTH

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

titi = Actor('bird1', (75, 350))
titi.speed = 1
print(tube_superieur.width, tube_inferieur.height)

vitesse_defilement = 1

pgzrun.go()

Ładowanie…
Anuluj
Zapisz