Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Corentin MIMEAU
PolyDefense
Commits
323da9ac
Commit
323da9ac
authored
Dec 08, 2015
by
Vincent BRULE
Browse files
up
parent
fe9c13f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
unite.py
View file @
323da9ac
...
...
@@ -103,13 +103,14 @@ class Unite:
nPos
=
(
self
.
position
[
0
]
+
dx
,
self
.
position
[
1
]
+
dy
)
self
.
position
=
nPos
if
self
.
proprietaire
==
2
:
if
nPos
[
0
]
/
Constante
.
taille_rel
==
1
and
nPos
[
1
]
/
Constante
.
taille_rel
==
4
:
print
"ok"
if
nPos
[
0
]
==
2
*
Constante
.
taille_rel
and
nPos
[
1
]
==
4
*
Constante
.
taille_rel
:
base
.
perte_sante
()
base
.
liste_unite
.
remove
(
self
)
self
.
affichage
=
0
if
self
.
proprietaire
==
1
:
if
nPos
[
0
]
==
27
*
Constante
.
taille_rel
and
nPos
[
1
]
==
4
*
Constante
.
taille_rel
:
base
.
perte_sante
()
base
.
liste_unite
.
remove
(
self
)
image_route_initiale
=
image
.
load
(
self
.
chemin_image_route
)
image_route_finale
=
transform
.
scale
(
image_route_initiale
,
(
Constante
.
taille_rel
,
Constante
.
taille_rel
))
ecran
.
blit
(
image_route_finale
,
(
Constante
.
taille_rel
*
2
,
Constante
.
taille_rel
*
4
))
self
.
affichage
=
0
return
...
...
@@ -151,7 +152,7 @@ class Unite_feu(Unite):
self
.
chemin_image_route
=
"route.png"
self
.
sante
=
50
# Santé du soldat
self
.
position
=
pos
# Position du soldat
self
.
vitesse
=
0.
0
01
# Vitesse du soldat
self
.
vitesse
=
0.01
# Vitesse du soldat
self
.
proprietaire
=
pro
# Propriétaire du soldat
self
.
violence
=
1
# Agressivité qu'apporte le soldat
self
.
prix
=
5
...
...
@@ -171,7 +172,7 @@ class Unite_glace(Unite):
self
.
chemin_image_route
=
"route.png"
self
.
sante
=
50
# Santé du soldat
self
.
position
=
pos
# Position du soldat
self
.
vitesse
=
0.01
# Vitesse du soldat
self
.
vitesse
=
0.
00
01
# Vitesse du soldat
self
.
proprietaire
=
pro
# Propriétaire du soldat
self
.
violence
=
1
# Agressivité qu'apporte le soldat
self
.
prix
=
5
...
...
Write
Preview
Markdown
is supported
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