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

chap1 challenge1 ok

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

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

@@ -1,12 +1,20 @@
import pgzrun
# création fenêtre
TITLE = "Paf l'oiseau" # définition titre
WIDTH = 708 # largeur
HEIGHT = 400 #hauteur

TITLE = "Paf l'oiseau"
WIDTH = 400
HEIGHT = 708
def on_mouse_down(): # fonction 'si click avec souris'
print('Clique souris !') # sortie en terminal pour verifier si c'est ok
titi.x -= 100

def update():
titi.x += titi.speed # mise a jour (60x/sec) de titi

def draw():
titi = Actor('bird1', (75, 350))
screen.blit('cascade', (0, 0))
screen.blit('background', (0, 0)) # import arrière plan
titi.draw() # 'dessiner' titi

pgzrun.go()
titi = Actor('bird1', (75, 350)) # définir position de titi
titi.speed = 5 # définir vitesses de chute de titi
pgzrun.go() # syntaxe 'conventionnelle' de pgzero

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