diff --git a/birdie.py b/birdie.py index 5c80b45..a863f0a 100644 --- a/birdie.py +++ b/birdie.py @@ -3,6 +3,7 @@ import pgzrun TITLE = "Paf l'oiseau" WIDTH = 400 HEIGHT = 708 +direction = 1 def on_mouse_down(): print('Stop!') @@ -13,9 +14,12 @@ def on_mouse_up(): blackbird.speed = 1 def update(): + if titi.left > WIDTH: + titi.right = 0 + if titi.right < 0: + titi.left = WIDTH titi.x += titi.speed - blackbird.x += blackbird.speed - + def draw(): screen.blit('background', (0, 0)) titi.draw()