diff --git a/audio/wood.mp3 b/audio/wood.mp3 new file mode 100644 index 0000000..bcd273a Binary files /dev/null and b/audio/wood.mp3 differ diff --git a/entrees.txt b/entrees.txt index 711f97b..563e565 100644 --- a/entrees.txt +++ b/entrees.txt @@ -1,27 +1,23 @@ -10.0 -3 +180.16800000000111 +2 13 21 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -1 3 0 0 2 2 2 2 2 2 2 0 2 0 2 2 2 2 0 5 1 -1 3 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 5 1 -1 0 0 2 0 2 2 0 2 2 2 2 0 2 2 2 2 2 2 0 1 -1 0 1 2 1 2 1 2 1 0 1 2 1 2 1 2 1 2 1 2 1 -1 2 2 2 0 2 2 2 0 0 2 2 2 2 2 0 2 2 2 2 1 -1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 0 1 2 1 2 1 -1 2 2 2 2 0 2 2 2 2 0 2 0 2 2 2 0 2 2 2 1 -1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 0 1 2 1 2 1 -1 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 1 -1 6 1 0 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 4 1 -1 6 0 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 0 4 1 +1 4 4 4 4 4 4 4 0 0 0 6 6 6 6 6 6 6 6 5 1 +1 3 1 3 1 4 1 4 1 3 1 5 1 6 1 5 1 5 1 5 1 +1 3 0 3 0 4 6 6 6 3 6 5 6 6 6 6 6 6 5 5 1 +1 3 1 3 1 4 1 4 1 3 1 6 1 6 1 4 1 4 1 5 1 +1 3 3 3 3 4 3 3 3 3 3 3 3 3 3 6 6 6 6 6 1 +1 3 1 3 1 3 1 4 1 3 1 6 1 6 1 4 1 4 1 4 1 +1 6 6 6 6 6 6 4 6 3 6 6 6 6 6 6 6 6 4 4 1 +1 3 1 3 1 3 1 6 1 3 1 6 1 6 1 4 1 4 1 4 1 +1 6 6 3 3 3 3 3 3 3 3 6 3 3 3 4 4 4 4 4 1 +1 3 1 6 1 6 1 6 1 3 1 6 1 6 1 4 1 4 1 4 1 +1 6 6 6 6 3 3 6 3 3 3 6 3 6 4 4 4 4 4 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 -4 -1 3 1 12.5 -11 18 1 12.5 -1 18 1 12.5 -11 2 1 12.5 -4 -3 1 0 0 0 1 0 0 -9 19 1 0 0 1 0 1 -3 19 2 0 1 1 0 0 -9 1 3 0 0 1 0 0 +0 +4 +3 6 0 0 2 5 2 2 +2 3 1 1 2 4 4 3 +3 8 2 3 1 1 1 1 +3 9 3 1 1 6 2 1 0 diff --git a/iachallenge2024_bomberman_tkinter.py b/iachallenge2024_bomberman_tkinter.py index dedcff3..f5684aa 100644 --- a/iachallenge2024_bomberman_tkinter.py +++ b/iachallenge2024_bomberman_tkinter.py @@ -342,7 +342,11 @@ def casse(plateau, powerups, i,j): if randrange(0,3)==0: powerups.append([i,j, randrange(5)]) return - + +def play_planks(): + playsound('./audio/wood.mp3') + return + def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, joueurs, powerups, pieges): if evenement[E_NATURE]==EVENEMENT_TOUR_JOUEUR: temps, nature, indiceJoueur = evenement @@ -415,8 +419,7 @@ def execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, jo return elif plateau[i][j]==PLATEAU_BOIS: # Bois : destructible, on détruit - '''CTS[CTPTR].start() - CTPTR = (CTPTR+1)%12''' + (Thread(target=play_planks)).start() casse(plateau, powerups, i,j) return else: @@ -465,23 +468,6 @@ Y_STEP_CLAIMS = 40 X_LARGEUR_EMPIRES = 60 Y_LARGEUR_EMPIRES = 180 -''' -CT1= Thread(target=play_planks) -CT2= Thread(target=play_planks) -CT3= Thread(target=play_planks) -CT4= Thread(target=play_planks) -CT5= Thread(target=play_planks) -CT6= Thread(target=play_planks) -CT7= Thread(target=play_planks) -CT8= Thread(target=play_planks) -CT9= Thread(target=play_planks) -CT10= Thread(target=play_planks) -CT11= Thread(target=play_planks) -CT12= Thread(target=play_planks) -CTS=[CT1, CT2, CT3, CT4, CT5, CT6, CT7, CT8, CT9, CT10, CT11, CT12] -CTPTR=0 -''' - def decision(programme, indiceJoueur, plateau, plateauCouleur, bombes, joueurs, powerups, instant): with open("entrees.txt", "w") as entrees: print(instant, file=entrees) @@ -524,7 +510,7 @@ def simulation(strategies): execute_evenement(evenements, evenement, plateau, plateauCouleur, bombes, joueurs, powerups, pieges) affiche_plateau(canvas, plateau, plateauCouleur, bombes, joueurs, powerups) affiche_infos(canvasInfosJoueurs, joueurs, plateauCouleur) - affiche_empires(canvasInfosJoueurs, joueurs, plateauCouleur) # very laggy for some reason + affiche_empires(canvasInfosJoueurs, joueurs, plateauCouleur) # very laggy for some reason # not anymore temps = int((evenements[0][0]-evenement[0])/3*200) if temps != 0: fenetre.after(temps, pas_de_jeu) @@ -563,9 +549,7 @@ def simulation(strategies): fenetre.mainloop() return - -def play_planks(): - playsound('./audio/wood-effect-254997.mp3') + #simulation(["./again"]) #simulation(["./again", "./again"]) simulation(["./again", "./again", "./again", "./again"])