Browse Source

challenge 5

challenge-6
Melissa 3 years ago
parent
commit
c8b80faa17
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      birdie.py

+ 6
- 2
birdie.py View File

@@ -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()


Loading…
Cancel
Save