Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Corentin MIMEAU
PolyDefense
Commits
0d4a7400
Commit
0d4a7400
authored
Nov 30, 2015
by
Vincent BRULE
Browse files
up
parent
a0cb1e24
Changes
1
Hide whitespace changes
Inline
Side-by-side
carte.py
View file @
0d4a7400
...
...
@@ -6,24 +6,28 @@ import os
from
carteStruct
import
*
from
constante
import
Constante
from
base
import
*
from
joueur
import
*
#ctrl+Q utile pour commenter
def
son_fond
(
verif
):
mixer
.
init
()
son_fond
=
mixer
.
Sound
(
"projet_jeux_video.wav"
)
if
verif
==
1
:
son_fond
.
play
(
loops
=
-
1
)
son_fond
.
set_volume
(
1.0
)
elif
verif
==
2
:
mixer
.
pause
()
elif
verif
==
3
:
mixer
.
unpause
()
if
Constante
.
son
==
0
:
if
verif
==
1
:
son_fond
.
play
(
loops
=
-
1
)
son_fond
.
set_volume
(
1.0
)
Constante
.
son
=
1
else
:
if
verif
==
2
:
mixer
.
pause
()
if
verif
==
3
:
mixer
.
unpause
()
def
fond_depart
(
ecran
):
image_depart
=
image
.
load
(
"ecran_depart.jpg"
)
...
...
@@ -86,25 +90,25 @@ def lecture_carte (fichier, carte): # Permet de lire le .txt contenant la carte
def
titre_nom
(
n_joueur
,
ecran
):
titre
=
"Entrer le nom du joueur"
+
" "
+
str
(
n_joueur
)
+
"
:
"
titre
=
"Entrer le nom du joueur"
+
" "
+
str
(
n_joueur
)
+
"
(Moins de 7 lettres svp) :
"
texte_titre
=
Constante
.
type_ecriture
.
render
(
titre
,
1
,
Constante
.
ORANGE
)
#texte_titre = Constante.type_ecriture.render(titre, 1, Constante.ORANGE, (204, 204, 255)) permet de mettre un fond de couleur
ecran
.
blit
(
texte_titre
,
(
Constante
.
largeur
/
4
,
Constante
.
hauteur
/
4
))
ecran
.
blit
(
texte_titre
,
(
Constante
.
largeur
/
6
,
Constante
.
hauteur
/
4
))
display
.
flip
()
def
nom_joueur
(
n_joueur
,
ecran
,
joueur
):
nom
=
''
nom
=
""
fond_depart
(
ecran
)
titre_nom
(
n_joueur
,
ecran
)
while
True
:
for
evenement_joueur
in
event
.
get
():
if
evenement_joueur
.
type
==
KEYDOWN
:
if
evenement_joueur
.
unicode
.
isalpha
():
nom
=
nom
+
evenement_joueur
.
unicode
texte
=
Constante
.
type_ecriture
.
render
(
nom
,
True
,
Constante
.
ORANGE
)
ecran
.
blit
(
texte
,
(
float
(
Constante
.
largeur
)
/
2.5
,
float
(
Constante
.
hauteur
)
/
2.5
))
if
len
(
nom
)
<
7
:
nom
=
nom
+
evenement_joueur
.
unicode
texte
=
Constante
.
type_ecriture
.
render
(
nom
,
True
,
Constante
.
ORANGE
)
ecran
.
blit
(
texte
,
(
float
(
Constante
.
largeur
)
/
2.5
,
float
(
Constante
.
hauteur
)
/
2.5
))
if
evenement_joueur
.
key
==
K_RETURN
:
joueur
.
modifier_nom
(
nom
)
joueur
.
modifier_numero
(
n_joueur
)
...
...
@@ -172,14 +176,33 @@ def ecran_regle (ecran):
if
Constante
.
largeur
/
2.3
<=
x
<=
Constante
.
largeur
/
1.8
and
Constante
.
hauteur
/
2.6
<=
y
<=
Constante
.
hauteur
/
1.6
:
return
def
maj_affichage_tourelle
(
ecran
,
liste
,
image
,
verif_tour
):
for
i
in
liste
:
# Parcours la liste comportant la position de l'herbe
if
verif_tour
==
1
:
if
i
[
0
]
<
16
:
ecran
.
blit
(
image
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
elif
verif_tour
==
2
:
if
i
[
0
]
>=
16
:
ecran
.
blit
(
image
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
else
:
ecran
.
blit
(
image
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
def
maj_affichage_argent
(
ecran
,
base_joueur
,
joueur
):
argent_joueur
=
Constante
.
type_ecriture
.
render
(
str
(
base_joueur
.
argent
)
+
" euros"
,
True
,
Constante
.
ORANGE
,
(
0
,
0
,
0
))
if
joueur
.
recuperer_numero
()
==
1
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
5
*
Constante
.
taille_rel
,
17
*
Constante
.
taille_rel
,
4
*
Constante
.
taille_rel
,
Constante
.
taille_rel
))
ecran
.
blit
(
argent_joueur
,
(
5
*
Constante
.
taille_rel
,
Constante
.
taille_rel
*
17
))
else
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
20
*
Constante
.
taille_rel
,
17
*
Constante
.
taille_rel
,
4
*
Constante
.
taille_rel
,
Constante
.
taille_rel
))
ecran
.
blit
(
argent_joueur
,
(
20
*
Constante
.
taille_rel
,
17
*
Constante
.
taille_rel
))
def
maj_affichage_liste
(
ecran
,
liste
,
image
):
for
i
in
liste
:
ecran
.
blit
(
image
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
display
.
flip
()
for
i
in
liste
:
ecran
.
blit
(
image
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
def
verif_pose_tourelle
(
ecran
,
carte
,
(
i
,
j
)):
if
(
i
,
j
)
not
in
carte
.
liste_herbe_avec_obstacle_simple
:
if
(
i
,
j
)
not
in
carte
.
liste_herbe_avec_obstacle_simple
and
(
i
,
j
)
not
in
carte
.
liste_herbe_avec_obstacle_base
and
(
i
,
j
)
not
in
carte
.
liste_herbe_avec_obstacle_arbre
and
(
i
,
j
)
not
in
carte
.
liste_route
:
if
(
i
-
1
,
j
)
not
in
carte
.
liste_herbe_avec_obstacle_arbre
and
(
i
-
1
,
j
)
not
in
carte
.
liste_herbe_avec_obstacle_base
:
if
(
i
,
j
-
1
)
not
in
carte
.
liste_herbe_avec_obstacle_arbre
and
(
i
,
j
-
1
)
not
in
carte
.
liste_herbe_avec_obstacle_base
:
if
(
i
-
1
,
j
-
1
)
not
in
carte
.
liste_herbe_avec_obstacle_arbre
and
(
i
-
1
,
j
-
1
)
not
in
carte
.
liste_herbe_avec_obstacle_base
:
...
...
@@ -193,18 +216,29 @@ def verif_pose_tourelle (ecran, carte, (i, j)):
def
affichage_chronometre
(
ecran
,
temps_passe
,
temps_depart
):
affichage_chrono
=
Constante
.
temps_tour
-
(
int
(
Constante
.
temps_passe
)
-
int
(
Constante
.
temps_depart
))
affichage_chrono_texte
=
Constante
.
type_ecriture_chrono
.
render
(
str
(
affichage_chrono
),
True
,
Constante
.
ORANGE
,
(
0
,
0
,
0
))
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
Constante
.
largeur
/
2
,
17
*
Constante
.
taille_rel
,
Constante
.
largeur
,
Constante
.
hauteur
))
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
Constante
.
largeur
/
2
,
17
*
Constante
.
taille_rel
,
Constante
.
taille_rel
,
Constante
.
taille_rel
))
ecran
.
blit
(
affichage_chrono_texte
,
(
Constante
.
largeur
/
2
,
17
*
Constante
.
taille_rel
))
display
.
flip
()
def
ecran_principal
(
ecran
,
j1
,
j2
,
verif_tour
):
son_fond
(
1
)
verif_son
=
0
def
couvrir_ecran_ennemie
(
ecran
,
verif_tour
):
if
Constante
.
ratio
==
1.6
:
if
verif_tour
==
1
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
Constante
.
largeur
/
2
,
0
,
Constante
.
largeur
/
2
,
17
*
Constante
.
hauteur
/
20
))
elif
verif_tour
==
2
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
0
,
0
,
15
*
Constante
.
largeur
/
32
,
17
*
Constante
.
hauteur
/
20
))
else
:
if
verif_tour
==
1
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
Constante
.
largeur
/
2
,
0
,
Constante
.
largeur
/
2
,
17
*
Constante
.
hauteur
/
18
))
elif
verif_tour
==
2
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
0
,
0
,
15
*
Constante
.
largeur
/
32
,
17
*
Constante
.
hauteur
/
18
))
def
ecran_principal
(
ecran
,
j1
,
j2
,
verif_tour
,
base_1
,
base_2
):
son_fond
(
1
)
#demarre le son
verif_base
=
0
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
0
,
0
,
Constante
.
largeur
,
Constante
.
hauteur
))
contour_milieu_soldat_image
=
image
.
load
(
"contour_milieu_soldat.png"
)
contour_milieu_soldat_image_2
=
image
.
load
(
"contour_milieu_soldat_2.png"
)
herbe_image
=
image
.
load
(
"herbe.png"
)
# Charge l'image de la pelouse
...
...
@@ -214,95 +248,184 @@ def ecran_principal(ecran, j1, j2, verif_tour):
sortie_ennemie_image
=
image
.
load
(
"milieu_soldat.png"
).
convert_alpha
()
base_image
=
image
.
load
(
"base.png"
).
convert_alpha
()
base2_image
=
image
.
load
(
"base2.png"
).
convert_alpha
()
tourelle_1_image
=
image
.
load
(
"tourelle_1.png"
)
choix_case_image
=
image
.
load
(
"choix_case.png"
)
contour_milieu_soldat_finale
=
transform
.
scale
(
contour_milieu_soldat_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
contour_milieu_soldat_finale_2
=
transform
.
scale
(
contour_milieu_soldat_image_2
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
herbe_finale
=
transform
.
scale
(
herbe_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
route_finale
=
transform
.
scale
(
route_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
arbre_finale
=
transform
.
scale
(
arbre_image
,(
2
*
Constante
.
taille_rel
,
2
*
Constante
.
taille_rel
))
contour_finale
=
transform
.
scale
(
contour_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
base_finale
=
transform
.
scale
(
base_image
,(
3
*
Constante
.
taille_rel
,
3
*
Constante
.
taille_rel
))
base2_finale
=
transform
.
scale
(
base2_image
,(
3
*
Constante
.
taille_rel
,
3
*
Constante
.
taille_rel
))
sortie_ennemie_finale
=
transform
.
scale
(
sortie_ennemie_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
carte
=
Carte
()
if
Constante
.
ratio
==
1.6
:
lecture_carte
(
"dico_carte_ratio_16_10.txt"
,
carte
)
# Lis le dictionnaire contenant la carte en fonction du ratio
else
:
lecture_carte
(
"dico_carte_ratio_16_9.txt"
,
carte
)
tourelle_1_choix
=
transform
.
scale
(
tourelle_1_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
tourelle_1_finale
=
transform
.
scale
(
tourelle_1_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
choix_case_finale
=
transform
.
scale
(
choix_case_image
,(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
if
Constante
.
verif_carte
==
0
:
global
carte
carte
=
Carte
()
if
Constante
.
ratio
==
1.6
:
lecture_carte
(
"dico_carte_ratio_16_10.txt"
,
carte
)
# Lis le dictionnaire contenant la carte en fonction du ratio
else
:
lecture_carte
(
"dico_carte_ratio_16_9.txt"
,
carte
)
for
i
in
carte
.
liste_herbe
:
# Parcours la liste comportant la position de l'herbe
ecran
.
blit
(
herbe_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
for
i
in
carte
.
liste_herbe_avec_obstacle_simple
:
# Parcours la liste comportant la position de l'herbe
ecran
.
blit
(
herbe_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
for
i
in
carte
.
liste_herbe_avec_obstacle_arbre
:
# Parcours la liste comportant la position de l'herbe
ecran
.
blit
(
herbe_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
for
i
in
carte
.
liste_herbe_avec_obstacle_base
:
# Parcours la liste comportant la position de l'herbe
ecran
.
blit
(
herbe_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
ecran
.
blit
(
herbe_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
for
i
in
carte
.
liste_route
:
# Parcours la liste comportant la position de la route
ecran
.
blit
(
route_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
for
i
in
carte
.
liste_arbre
:
# Parcours la liste comportant la position des arbres
ecran
.
blit
(
arbre_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
for
i
in
carte
.
liste_contour
:
ecran
.
blit
(
contour_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
for
i
in
carte
.
liste_contour_sortie_ennemie
:
ecran
.
blit
(
contour_milieu_soldat_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
for
i
in
carte
.
liste_contour_sortie_ennemie_2
:
ecran
.
blit
(
contour_milieu_soldat_finale_2
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
for
i
in
carte
.
liste_base
:
if
verif_base
==
0
:
ecran
.
blit
(
base_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
verif_base
=
verif_base
+
1
else
:
ecran
.
blit
(
base2_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
for
i
in
carte
.
liste_sortie_ennemie
:
ecran
.
blit
(
sortie_ennemie_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
for
i
in
carte
.
liste_tourelle_1
:
# Parcours la liste comportant la position de l'herbe
if
verif_tour
==
1
:
if
i
[
0
]
<
16
:
ecran
.
blit
(
tourelle_1_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
if
verif_tour
==
2
:
if
i
[
0
]
>=
16
:
ecran
.
blit
(
tourelle_1_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
else
:
ecran
.
blit
(
tourelle_1_finale
,
(
i
[
0
]
*
Constante
.
taille_rel
,
i
[
1
]
*
Constante
.
taille_rel
))
# Met l'image dans le fond
if
verif_tour
==
1
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
Constante
.
largeur
/
2
,
0
,
Constante
.
largeur
/
2
,
Constante
.
hauteur
))
elif
verif_tour
==
2
:
draw
.
rect
(
ecran
,
(
0
,
0
,
0
),
(
0
,
0
,
15
*
Constante
.
largeur
/
32
,
Constante
.
hauteur
))
couvrir_ecran_ennemie
(
ecran
,
verif_tour
)
texte_joueur
=
Constante
.
type_ecriture
.
render
(
j1
.
nom
,
True
,
Constante
.
ORANGE
,
(
255
,
255
,
255
)
)
texte_joueur2
=
Constante
.
type_ecriture
.
render
(
j2
.
nom
,
True
,
Constante
.
ORANGE
,
(
255
,
255
,
255
)
)
ecran
.
blit
(
texte_joueur
,
(
Constante
.
taille_rel
,
((
Constante
.
largeur
)
/
Constante
.
largeur_ref
)
))
ecran
.
blit
(
texte_joueur2
,
(
7
*
Constante
.
largeur
/
8
,
((
Constante
.
largeur
)
/
Constante
.
largeur_ref
)
))
texte_joueur
=
Constante
.
type_ecriture
.
render
(
j1
.
nom
,
True
,
Constante
.
ORANGE
)
texte_joueur2
=
Constante
.
type_ecriture
.
render
(
j2
.
nom
,
True
,
Constante
.
ORANGE
)
ecran
.
blit
(
texte_joueur
,
(
0
,
Constante
.
taille_rel
*
17
))
ecran
.
blit
(
texte_joueur2
,
(
28
*
Constante
.
taille_rel
,
Constante
.
taille_rel
*
17
))
display
.
flip
()
# Fais apparatre les diffrents lments chargs
maj_affichage_argent
(
ecran
,
base_1
,
j1
)
maj_affichage_argent
(
ecran
,
base_2
,
j2
)
Constante
.
verif_carte
=
1
Constante
.
temps_passe
=
time
.
time
()
Constante
.
temps_depart
=
time
.
time
()
while
Constante
.
temps_passe
-
Constante
.
temps_depart
<
Constante
.
temps_tour
:
for
evenement_joueur
in
event
.
get
():
if
evenement_joueur
.
type
==
KEYDOWN
:
if
evenement_joueur
.
key
==
K_ESCAPE
:
quit
()
if
evenement_joueur
.
key
==
K_s
:
if
verif_son
%
2
==
0
:
verif_son
=
verif_son
+
1
elif
evenement_joueur
.
key
==
K_SPACE
:
return
elif
evenement_joueur
.
key
==
K_s
:
if
Constante
.
verif_son
%
2
==
0
:
Constante
.
verif_son
=
Constante
.
verif_son
+
1
son_fond
(
2
)
elif
verif_son
%
2
==
1
:
verif_son
=
verif_son
+
1
elif
Constante
.
verif_son
%
2
==
1
:
Constante
.
verif_son
=
Constante
.
verif_son
+
1
son_fond
(
3
)
if
evenement_joueur
.
type
==
MOUSEBUTTONDOWN
:
if
evenement_joueur
.
type
==
MOUSEBUTTONDOWN
:
couvrir_ecran_ennemie
(
ecran
,
verif_tour
)
(
x
,
y
)
=
evenement_joueur
.
pos
(
u
,
v
)
=
(
x
/
Constante
.
taille_rel
,
y
/
Constante
.
taille_rel
)
for
(
i
,
j
)
in
carte
.
liste_herbe
:
if
u
==
i
and
v
==
j
:
if
verif_tour
==
1
:
if
i
<
16
:
if
verif_pose_tourelle
(
ecran
,
carte
,
(
i
,
j
))
==
True
:
carte
.
liste_sortie_ennemie
.
append
((
i
,
j
))
maj_affichage_liste
(
ecran
,
carte
.
liste_sortie_ennemie
,
sortie_ennemie_finale
)
if
verif_tour
==
2
:
if
i
>=
16
:
if
verif_pose_tourelle
(
ecran
,
carte
,
(
i
,
j
))
==
True
:
carte
.
liste_sortie_ennemie
.
append
((
i
,
j
))
maj_affichage_liste
(
ecran
,
carte
.
liste_sortie_ennemie
,
sortie_ennemie_finale
)
(
g
,
b
)
=
(
Constante
.
position
[
0
]
*
Constante
.
taille_rel
,
Constante
.
position
[
1
]
*
Constante
.
taille_rel
)
if
(
u
,
v
)
in
carte
.
liste_tourelle_1
:
if
verif_tour
==
1
:
if
Constante
.
position
[
0
]
<
16
:
if
verif_pose_tourelle
(
ecran
,
carte
,
(
Constante
.
position
[
0
],
Constante
.
position
[
1
]))
==
True
:
ecran
.
blit
(
herbe_finale
,
(
g
,
b
))
else
:
if
Constante
.
position
[
0
]
>=
16
:
if
verif_pose_tourelle
(
ecran
,
carte
,
(
Constante
.
position
[
0
],
Constante
.
position
[
1
]))
==
True
:
ecran
.
blit
(
herbe_finale
,
(
g
,
b
))
Constante
.
verif_cadre_rouge
=
0
else
:
if
Constante
.
verif_cadre_rouge
==
1
:
if
Constante
.
position
in
carte
.
liste_tourelle_1
:
ecran
.
blit
(
tourelle_1_finale
,
(
g
,
b
))
else
:
ecran
.
blit
(
herbe_finale
,
(
g
,
b
))
Constante
.
verif_cadre_rouge
=
0
if
(
u
,
v
)
==
(
18
,
3
):
if
verif_tour
==
1
:
if
Constante
.
position
in
carte
.
liste_herbe
:
if
verif_pose_tourelle
(
ecran
,
carte
,
Constante
.
position
)
==
True
:
couvrir_ecran_ennemie
(
ecran
,
verif_tour
)
if
base_1
.
depenser_argent
(
10
)
!=
"NON"
:
carte
.
liste_tourelle_1
.
append
(
Constante
.
position
)
maj_affichage_tourelle
(
ecran
,
carte
.
liste_tourelle_1
,
tourelle_1_finale
,
verif_tour
)
maj_affichage_argent
(
ecran
,
base_1
,
j1
)
elif
(
u
,
v
)
==
(
12
,
3
):
if
verif_tour
==
2
:
if
Constante
.
position
in
carte
.
liste_herbe
:
if
verif_pose_tourelle
(
ecran
,
carte
,
Constante
.
position
)
==
True
:
couvrir_ecran_ennemie
(
ecran
,
verif_tour
)
if
base_2
.
depenser_argent
(
10
)
!=
"NON"
:
carte
.
liste_tourelle_1
.
append
(
Constante
.
position
)
maj_affichage_tourelle
(
ecran
,
carte
.
liste_tourelle_1
,
tourelle_1_finale
,
verif_tour
)
maj_affichage_argent
(
ecran
,
base_2
,
j2
)
for
(
i
,
j
)
in
carte
.
liste_herbe
:
if
u
==
i
and
v
==
j
:
if
verif_tour
==
1
:
if
i
<
16
:
if
verif_pose_tourelle
(
ecran
,
carte
,
(
i
,
j
))
==
True
:
ecran
.
blit
(
tourelle_1_choix
,
(
18
*
Constante
.
taille_rel
,
3
*
Constante
.
taille_rel
))
ecran
.
blit
(
choix_case_finale
,
(
i
*
Constante
.
taille_rel
,
j
*
Constante
.
taille_rel
))
Constante
.
verif_cadre_rouge
=
1
if
verif_tour
==
2
:
if
i
>=
16
:
if
verif_pose_tourelle
(
ecran
,
carte
,
(
i
,
j
))
==
True
:
ecran
.
blit
(
tourelle_1_choix
,
(
12
*
Constante
.
taille_rel
,
3
*
Constante
.
taille_rel
))
ecran
.
blit
(
choix_case_finale
,
(
i
*
Constante
.
taille_rel
,
j
*
Constante
.
taille_rel
))
Constante
.
verif_cadre_rouge
=
1
Constante
.
position
=
(
u
,
v
)
affichage_chronometre
(
ecran
,
Constante
.
temps_passe
,
Constante
.
temps_depart
)
display
.
flip
()
Constante
.
temps_passe
=
time
.
time
()
return
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment