|
@@ -4,23 +4,26 @@ TITLE = "Paf l'oiseau" |
|
|
WIDTH = 400 |
|
|
WIDTH = 400 |
|
|
HEIGHT = 708 |
|
|
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(): |
|
|
def update(): |
|
|
|
|
|
if titi.left > WIDTH: |
|
|
|
|
|
titi.right = 0 |
|
|
|
|
|
if titi.right < 0: |
|
|
|
|
|
titi.left = WIDTH |
|
|
titi.x += titi.vitesse |
|
|
titi.x += titi.vitesse |
|
|
titi2.x += titi2.vitesse |
|
|
|
|
|
|
|
|
|
|
|
def draw(): |
|
|
def draw(): |
|
|
screen.blit('background', (0, 0)) |
|
|
screen.blit('background', (0, 0)) |
|
|
titi.draw() |
|
|
titi.draw() |
|
|
titi2.draw() |
|
|
|
|
|
|
|
|
|
|
|
titi = Actor('bird1', (75, 350)) |
|
|
titi = Actor('bird1', (75, 350)) |
|
|
titi2 = Actor('bird0', (65,300)) |
|
|
|
|
|
titi.vitesse = 1 |
|
|
titi.vitesse = 1 |
|
|
titi2.vitesse = 2 |
|
|
|
|
|
|
|
|
|
|
|
pgzrun.go() |
|
|
pgzrun.go() |