Compare commits

...

Аутор SHA1 Порука Датум
  cyclopsng 5e7d2d7092 fin challenge chap 1 пре 3 година
  cyclopsng 1df8f3c0e5 test 2 пре 3 година
  cyclopsng bfb6d1904b retour ecran ok пре 3 година
  cyclopsng 09fdf550cb copie пре 3 година
  cyclopsng ddc9fcb309 Merge branch 'titi_bouge' of https://git.techprog.be/cyclopsng/birdie_et_titi into titi_bouge пре 3 година
  cyclopsng 34fdd97c63 meme fond пре 3 година
  cyclopsng fd10274f23 Mise à jour de 'titi_bouge' пре 3 година
  cyclopsng 28758e0102 fichier titi bouge пре 3 година
  cyclopsng 450207c8ee titi bouge пре 3 година
6 измењених фајлова са 77 додато и 19 уклоњено
  1. +7
    -1
      birdie.py
  2. BIN
     
  3. BIN
     
  4. BIN
     
  5. +37
    -0
      titi_bouge
  6. +33
    -18
      titi_grominet.py

+ 7
- 1
birdie.py Прегледај датотеку

@@ -3,7 +3,7 @@ import pgzrun

TITLE = "Paf l'oiseau"
WIDTH = 400
HEIGHT = 762
HEIGHT = 708
def on_mouse_down():
print('Clic souris !')
titi.y -= 50 # deplacement horizontal
@@ -21,6 +21,12 @@ def update():
titi.y += titi.speed
#titi.x += tit.speed fera deplacer lateralement
#si on modifie le 1 on augmente la vitesse de la chute
if titi.left > WIDTH :
titi.right = 0
# titi left -> pgzrun interprete le calcul par rapport a image background
# et donc le fond de background est mis a 400 dans la variable width,
# ce qui donne que si la partie gauche de l'image titi est positionné a
# un niveau sup a la valeur de width, il se retrouve a un position 0
titi.speed = 1

pgzrun.go()




+ 37
- 0
titi_bouge Прегледај датотеку

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


TITLE = "Titi et Grosminet"
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()

+ 33
- 18
titi_grominet.py Прегледај датотеку

@@ -3,30 +3,28 @@ import pgzrun

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

# 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
def on_mouse_down(button):
print('Clic souris !')
print (button)
if mouse.LEFT is button :
titi.y -= 0 # deplacement horizontal
titi.x += 25 # deplacement latéral
grominet.y -= 0 # deplacement horizontal
grominet.x += 40 # deplacement latéral
if mouse.RIGHT is button :
titi.y += 0 # deplacement horizontal
titi.x -= 25 # deplacement latéral
grominet.y += 0 # deplacement horizontal
grominet.x -= 40 # deplacement latéral
# cela correspond au deplacement de titi du bas vers le haut

# deplacement stoppé
def on_mouse_down():
print('Clic souris !')
titi.y -= 0 # deplacement horizontal
titi.x += 0 # deplacement latéral
grominet.y -= 0 # deplacement horizontal
grominet.x += 0 # deplacement latéral
titi.speed = 0
grominet.speed = 0
# cela correspond a stopper deplacement des perso


def draw():
screen.blit('cascade', (0, 0))
screen.blit('meme', (0, 0))
titi.draw()
grominet.draw()
#titi = Actor('bird1', (70, 40))
@@ -41,6 +39,23 @@ def update():
#titi.x += tit.speed fera deplacer lateralement
#si on modifie le 1 on augmente la vitesse de la chute

# modif si tombe en bas, doit reapparaitre en haut
if titi.top > HEIGHT :
titi.bottom = 0
if titi.bottom > HEIGHT :
titi.top = 400
if grominet.top > HEIGHT :
grominet.bottom = 0
if grominet.bottom > HEIGHT :
grominet.top = 400
if grominet.left > WIDTH :
grominet.right = 0
if grominet.right > WIDTH :
grominet.left = 700
if titi.left > WIDTH :
titi.right = 0
if titi.right > WIDTH :
titi.left = 0
titi.speed = 1
grominet.speed = 1
pgzrun.go()

Loading…
Откажи
Сачувај