Browse Source

fichier titi bouge

titi_bouge
cyclopsng 3 years ago
parent
commit
28758e0102
1 changed files with 37 additions and 0 deletions
  1. +37
    -0
      titi_bouge

+ 37
- 0
titi_bouge View File

@@ -0,0 +1,37 @@
import pgzrun


TITLE = "Paf l'oiseau"
WIDTH = 400
HEIGHT = 762

# deplacement latéral
def on_mouse_down():
print('Clic souris !')
titi.y -= 50 # deplacement horizontal
titi.x += 25 # deplacement latéral
grominet.y -= 50 # deplacement horizontal
grominet.x += 40 # deplacement latéral
# cela correspond au deplacement de titi du bas vers le haut



def draw():
screen.blit('cascade', (0, 0))
titi.draw()
grominet.draw()
#titi = Actor('bird1', (70, 40))
titi = Actor('titi', (200, 60))
grominet = Actor('grominet', (70, 40))
#(70, 350) le premier chiffre position de depart sur axe x
# le deuxieme chiffre position axe y

def update():
titi.y += titi.speed
grominet.y += grominet.speed
#titi.x += tit.speed fera deplacer lateralement
#si on modifie le 1 on augmente la vitesse de la chute

titi.speed = 1
grominet.speed = 1
pgzrun.go()

Loading…
Cancel
Save