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