|
@@ -3,6 +3,7 @@ import pgzrun |
|
|
TITLE = "Paf l'oiseau" |
|
|
TITLE = "Paf l'oiseau" |
|
|
WIDTH = 400 |
|
|
WIDTH = 400 |
|
|
HEIGHT = 708 |
|
|
HEIGHT = 708 |
|
|
|
|
|
direction = 1 |
|
|
|
|
|
|
|
|
def on_mouse_down(): |
|
|
def on_mouse_down(): |
|
|
print('Stop!') |
|
|
print('Stop!') |
|
@@ -13,9 +14,12 @@ def on_mouse_up(): |
|
|
blackbird.speed = 1 |
|
|
blackbird.speed = 1 |
|
|
|
|
|
|
|
|
def update(): |
|
|
def update(): |
|
|
|
|
|
if titi.left > WIDTH: |
|
|
|
|
|
titi.right = 0 |
|
|
|
|
|
if titi.right < 0: |
|
|
|
|
|
titi.left = WIDTH |
|
|
titi.x += titi.speed |
|
|
titi.x += titi.speed |
|
|
blackbird.x += blackbird.speed |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def draw(): |
|
|
def draw(): |
|
|
screen.blit('background', (0, 0)) |
|
|
screen.blit('background', (0, 0)) |
|
|
titi.draw() |
|
|
titi.draw() |
|
|