1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| import pygame
from pygame import*
pygame.init()
inProgress=True
maliste=[[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0]
]
n=0
RED= (255,0,0)
blue=(0,255,0)
maSurface=pygame.display.set_mode((400,400))
monCarre=pygame.draw.rect(maSurface,RED,(100,100,300,300))
monRond=image.load("pionMilieuSansJouer.png")
x=10
y=10
stop = 0
while inProgress:
for event in pygame.event.get():
if event.type ==QUIT:
inProgress=False
#j'ai pensé a un double for i in range(6) pour lire les ligne et colone et donc afficher en fonction de la valeur ca a fonctionner mais ca affiche que quand on quitte :/
for i in range(6):
for j in range(6):
if maliste[i][j]==0:
maSurface.blit(monRond,(x,y))
x+=30
x=10
y+=30
pygame.display.update()
pygame.quit() |
Partager