Permalink
Browse files

Ajout d'une image

  • Loading branch information...
robertvandeneynde committed Jan 24, 2018
1 parent d4d500a commit 84cfeed841f5632cd98c7216305781b2939e32de
Showing with 8 additions and 11 deletions.
  1. BIN 3D-icon-bird-left.png
  2. BIN 3D-icon-bird-right.png
  3. +8 −11 pygame0_code_minimal.py
View
BIN +5.89 KB 3D-icon-bird-left.png
Binary file not shown.
View
BIN +5.76 KB 3D-icon-bird-right.png
Binary file not shown.
View
@@ -16,7 +16,9 @@
# DÉBUT # DÉBUT
ma_position = 600 ma_position = 600
sens = 1
image_gauche = pygame.image.load('3D-icon-bird-left.png').convert_alpha()
image_droite = pygame.image.load('3D-icon-bird-right.png').convert_alpha()
clock = pygame.time.Clock() clock = pygame.time.Clock()
@@ -29,15 +31,10 @@
# TICK # TICK
if sens == -1: ma_position = ma_position - 5
ma_position = ma_position - 5
else:
ma_position = ma_position + 5
if ma_position > 700: if ma_position > 700:
sens = -1 ma_position = 0
if ma_position < 0: print(ma_position)
sens = 1
print(sens, ma_position)
# DESSIN # DESSIN
ecran.fill(BLANC) ecran.fill(BLANC)
@@ -46,9 +43,9 @@
pygame.draw.circle(ecran, BLEU, [100,200], 20) pygame.draw.circle(ecran, BLEU, [100,200], 20)
pygame.draw.circle(ecran, VERT, [ma_position, 80], 10) pygame.draw.circle(ecran, VERT, [ma_position, 80], 10)
if sens == -1: if sens == -1:
pygame.draw.polygon(ecran, ROUGE, [[0,50], [100,0], [100,100]]) ecran.blit(image_gauche, [10,10])
else: else:
pygame.draw.polygon(ecran, ROUGE, [[100,50], [0,0], [0,100]]) ecran.blit(image_droite, [10,10])
pygame.display.flip() pygame.display.flip()

0 comments on commit 84cfeed

Please sign in to comment.