Ver código fonte

commentaire

chapitre-1-challenge-1
Cleason 3 anos atrás
pai
commit
ecb6a6c998
1 arquivos alterados com 11 adições e 11 exclusões
  1. +11
    -11
      birdie.py

+ 11
- 11
birdie.py Ver arquivo

@@ -8,35 +8,35 @@ def draw():
screen.blit('cascade', (0, 0))
titi = Actor('bird1', (75, 350))
bird = Actor('bird0', (75, 350))
# bird = Actor('bird0', (75, 350))

def draw():
screen.blit('background', (0, 0))
titi.draw()
bird.draw()
# bird.draw()

def on_mouse_up():
print('Clic souris !')
titi.y -= 50 # équivalent à titi.y = titi.y - 50
bird.x -= 50 # équivalent à bird.x = bird.x - 60
# bird.x -= 50 # équivalent à bird.x = bird.x - 60

def on_mouse_down():
print('Stop')
titi.speed = 0 # équivalent à titi.y = titi.y 0
bird.speed = 0 # équivalent à bird.x = bird.x 0
# def on_mouse_down():
# print('Stop')
# titi.speed = 0 # équivalent à titi.y = titi.y 0
# # bird.speed = 0 # équivalent à bird.x = bird.x 0

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

if titi.y > 400 :
titi.y = 0

if bird.x > 400 :
bird.x = 0
# if bird.x > 400 :
# bird.x = 0

titi.speed = 1
bird.speed = 1
# bird.speed = 1


pgzrun.go()

Carregando…
Cancelar
Salvar