Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
isn:pygame03 [2019/11/14 11:06] techer.charles_educ-valadon-limoges.fr [La fonction rotate] |
isn:pygame03 [2019/11/14 11:17] (Version actuelle) techer.charles_educ-valadon-limoges.fr [Les activités ...] |
||
---|---|---|---|
Ligne 53: | Ligne 53: | ||
x_fraise = 50 | x_fraise = 50 | ||
y_fraise = 50 | y_fraise = 50 | ||
- | largeur_fraise = 40 | ||
- | hauteur_fraise = 40 | ||
- | IMG_FRAISE = pygame.image.load(" | ||
- | # image Ballon | + | IMG_FRAISE |
- | x_ballon = 10 | + | # |
- | y_ballon = 10 | + | |
- | largeur_ballon = 20 | + | |
- | hauteur_ballon = 20 | + | |
- | IMG_BALLON | + | |
- | ballonSpeed = [1, 0] | + | |
- | #IMG_BALLON.move(ballonSpeed) | + | |
- | ballonRect | + | |
while not ARRET: | while not ARRET: | ||
pygame.time.delay(100) | pygame.time.delay(100) | ||
Ligne 73: | Ligne 64: | ||
sys.exit() | sys.exit() | ||
elif event.type == pygame.KEYDOWN: | elif event.type == pygame.KEYDOWN: | ||
+ | # symétrie axiale | ||
if event.key == pygame.K_RIGHT: | if event.key == pygame.K_RIGHT: | ||
- | | + | |
+ | elif event.key == pygame.K_UP: | ||
+ | IMG_FRAISE = pygame.transform.flip(IMG_FRAISE, | ||
+ | # rotation | ||
elif event.key == pygame.K_LEFT: | elif event.key == pygame.K_LEFT: | ||
- | | + | |
- | + | # redimensionner | |
- | ECRAN.blit(IMG_FRAISE, | + | elif event.key == pygame.K_DOWN: |
- | + | | |
- | ECRAN.blit(IMG_BALLON, | + | |
- | ballonRect | + | |
- | if ballonRect.right > LARGEUR: | + | |
- | | + | |
- | | + | ECRAN.blit(IMG_FRAISE, |
+ | | ||
</ | </ | ||
==== Les activités ... ==== | ==== Les activités ... ==== | ||
Ligne 93: | Ligne 85: | ||
- | https:// | + | https:// |
< | < | ||
- | <iframe height=" | + | <iframe height=" |
</ | </ | ||