|
|
@@ -8,6 +8,13 @@ def on_mouse_down(): |
|
|
|
print('Clic souris !') |
|
|
|
titi.y -= 50 |
|
|
|
|
|
|
|
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 |
|
|
|
tube_superieur.x -= vitesse_defilement |
|
|
@@ -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)) |
|
|
@@ -29,6 +38,7 @@ tube_superieur = Actor('top', (300, 0)) |
|
|
|
tube_inferieur = Actor('bottom', (300, tube_superieur.height + ecart)) |
|
|
|
vitesse_defilement = 1 |
|
|
|
|
|
|
|
|
|
|
|
# print(tube_superieur.width, tube_superieur.height) |
|
|
|
|
|
|
|
pgzrun.go() |