Просмотр исходного кода

mise à jour challenge_1

chapitre-1-challenge-1
Jordan Pleugers 3 лет назад
Родитель
Сommit
b8cb34d083
1 измененных файлов: 14 добавлений и 3 удалений
  1. +14
    -3
      birdie.py

+ 14
- 3
birdie.py Просмотреть файл

@@ -4,18 +4,29 @@ WIDTH = 400
HEIGHT = 708

def on_mouse_down():
print('Clic enfoncé souris !')
titi.speed = 0
titi2.speed = 0
titi.x -= 50
titi2.y -= 50
def on_mouse_up():
print('Clic souris !')
titi.y -= 50 # équivalent à titi.y = titi.y - 50
titi.speed = 2
titi2.speed = 2

def update():
titi.y += titi.speed
titi.x += titi.speed
titi2.y += titi2.speed

def draw():
screen.blit('background', (0, 0))
titi.draw()
titi2.draw()
titi = Actor('bird1', (75, 350))
titi2 = Actor('bird2', (75, 350))

titi.speed = 0
titi.speed = 1
titi2.speed = 1

pgzrun.go()

Загрузка…
Отмена
Сохранить