|
@@ -21,12 +21,13 @@ def draw(): |
|
|
screen.blit('background', (0, 0)) |
|
|
screen.blit('background', (0, 0)) |
|
|
titi.draw() |
|
|
titi.draw() |
|
|
titi2.draw() |
|
|
titi2.draw() |
|
|
poteau_1.draw() |
|
|
|
|
|
poteau_2.draw() |
|
|
|
|
|
|
|
|
tube_sup.draw() |
|
|
|
|
|
tube_inf.draw() |
|
|
titi = Actor('bird1', (75, 350)) |
|
|
titi = Actor('bird1', (75, 350)) |
|
|
titi2 = Actor('bird2', (75, 350)) |
|
|
titi2 = Actor('bird2', (75, 350)) |
|
|
poteau_1 = Actor('bottom',(300,800)) |
|
|
|
|
|
poteau_2 = Actor('top',(300, -100)) |
|
|
|
|
|
|
|
|
ecart = 140 |
|
|
|
|
|
tube_sup = Actor('top', (300, 0)) |
|
|
|
|
|
tube_inf = Actor('bottom', (300, tube_sup.height + ecart)) |
|
|
|
|
|
|
|
|
def update(): |
|
|
def update(): |
|
|
titi.x += titi.speed |
|
|
titi.x += titi.speed |
|
@@ -35,9 +36,19 @@ def update(): |
|
|
titi.x = 0 |
|
|
titi.x = 0 |
|
|
if titi2.y > 708 : |
|
|
if titi2.y > 708 : |
|
|
titi2.y = 0 |
|
|
titi2.y = 0 |
|
|
|
|
|
|
|
|
|
|
|
vitesse_defilement = 1 |
|
|
|
|
|
tube_sup.x += vitesse_defilement |
|
|
|
|
|
tube_inf.x += vitesse_defilement |
|
|
|
|
|
if tube_sup.x + tube_sup.width/2< 0 : |
|
|
|
|
|
tube_sup.x = WIDTH + tube_sup.width/2 |
|
|
|
|
|
tube_inf.x = WIDTH + tube_sup.width/2 |
|
|
|
|
|
if tube_sup.x < 0 : |
|
|
|
|
|
tube_sup.x = WIDTH |
|
|
|
|
|
|
|
|
titi.speed = 1 |
|
|
titi.speed = 1 |
|
|
titi2.speed = 1 |
|
|
titi2.speed = 1 |
|
|
|
|
|
|
|
|
pgzrun.go() |
|
|
pgzrun.go() |
|
|
|
|
|
|
|
|
|
|
|
print(tube_sup.width, tube_sup.height) |
|
|
|
|
|
vitesse_defilement = 1 |