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

chapitre.1-start-base

chapitre-1-start
antoine 3 лет назад
Родитель
Сommit
df70f51914
1 измененных файлов: 8 добавлений и 27 удалений
  1. +8
    -27
      birdie.py

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

@@ -4,39 +4,20 @@ TITLE = "Paf l'oiseau"
WIDTH = 400 WIDTH = 400
HEIGHT = 700 HEIGHT = 700


titi = Actor('bird1', (300,10))
titi2 = Actor('bird2', (125,75))
pot1 = Actor('top',(300,-100))
pot2 = Actor('bottom',(300,800))
titi = Actor('bird1',(75,350))

titi.speed = 1


def draw(): def draw():
screen.blit('background',(0,0)) screen.blit('background',(0,0))
titi.draw() titi.draw()
titi2.draw()
pot1.draw()
pot2.draw()


def on_mouse_down(): def on_mouse_down():
print('Clic souris !')
titi.speed = 0
titi2.speed = 0

def on_mouse_up():
print('clic souris !')
titi.speed = 2
titi2.speed = 2

print('Clic souris!')
titi.y -= 50
def update(): def update():
titi.y += titi.speed titi.y += titi.speed
titi2.x += titi2.speed
if titi.y > 700 :
if titi.y > 700:
titi.y = 0 titi.y = 0
if titi2.x > 400 :
titi2.x = 0



titi.speed = 1
titi2.speed = 1

pgzrun.go()
pgzrun.go()

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