ソースを参照

chap1 start ok

chapitre-1-start
ophelie 3年前
コミット
7d3e9fbe42
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 = 400 # largeur
HEIGHT = 708 #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.y -= 100

def update():
titi.y += 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

読み込み中…
キャンセル
保存