Browse Source

chap1 start ok

chapitre-1-start
ophelie 3 years ago
parent
commit
7d3e9fbe42
1 changed files with 14 additions and 6 deletions
  1. +14
    -6
      birdie.py

+ 14
- 6
birdie.py View File

@@ -1,12 +1,20 @@
import pgzrun 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(): 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

Loading…
Cancel
Save