Labyrinthe : Python et pygame
vaxx
-
vaxx -
vaxx -
Bonjour,
Je souhaiterais savoir comment afficher les murs pour mon programme d'ISN suivant pour la construction d'un labyrinthe (à priori ma def est juste mais ma boucle infini non). Comment corriger cela?
import pygame
from pygame.locals import *
from constantes import *
from niveau import *
pygame.init()
#Ouverture de la fenêtre Pygame
fenetre = pygame.display.set_mode((longueur_fen, largeur_fen))
#Chargement et collage du fond
fond = pygame.image.load("images/fond1.jpg").convert()
mur = pygame.image.load("images/mur.png")
fenetre.blit(fond, (0,0))
def _init_(niveau):
for i in range(0,35):
for j in range(0,20):
if niveau[i][j]==1:
fenetre.blit(mur,(x,y))
pygame.display.flip()
# Boucle inifinie
continuer = 1
while continuer:
for event in pygame.event.get():
if event.type == pygame.QUIT:
continuer = False
pygame.display.flip()
Je souhaiterais savoir comment afficher les murs pour mon programme d'ISN suivant pour la construction d'un labyrinthe (à priori ma def est juste mais ma boucle infini non). Comment corriger cela?
import pygame
from pygame.locals import *
from constantes import *
from niveau import *
pygame.init()
#Ouverture de la fenêtre Pygame
fenetre = pygame.display.set_mode((longueur_fen, largeur_fen))
#Chargement et collage du fond
fond = pygame.image.load("images/fond1.jpg").convert()
mur = pygame.image.load("images/mur.png")
fenetre.blit(fond, (0,0))
def _init_(niveau):
for i in range(0,35):
for j in range(0,20):
if niveau[i][j]==1:
fenetre.blit(mur,(x,y))
pygame.display.flip()
# Boucle inifinie
continuer = 1
while continuer:
for event in pygame.event.get():
if event.type == pygame.QUIT:
continuer = False
pygame.display.flip()
A voir également:
- Projet labyrinthe python
- Filigrane projet - Guide
- Citizen code python avis - Accueil - Outils
- Gant projet - Télécharger - Gestion de projets
- Projet x streaming vf - Forum MacOS
- \R python ✓ - Forum Python
for i in range(0,35):
for j in range(0,20):
if niveau[i][j]==1:
fenetre.blit(mur,(30*i,30*j))
pygame.display.flip()