Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Groupe 16
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Paul Ripault
Groupe 16
Commits
2d92f8ef
Commit
2d92f8ef
authored
4 years ago
by
Maxime Wallart
Browse files
Options
Downloads
Patches
Plain Diff
update mouvement
parent
8b13ccdf
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/Main.java
+3
-9
3 additions, 9 deletions
src/main/Main.java
src/units/Unite.java
+10
-1
10 additions, 1 deletion
src/units/Unite.java
with
13 additions
and
10 deletions
src/main/Main.java
+
3
−
9
View file @
2d92f8ef
...
@@ -22,23 +22,18 @@ public class Main {
...
@@ -22,23 +22,18 @@ public class Main {
int
x
=
11
;
int
x
=
11
;
int
y
=
10
;
int
y
=
10
;
plateau
.
getCase
(
x
,
y
).
setUnite
(
new
Paysant
(
x
,
y
,
plateau
,
winner
));
plateau
.
getCase
(
x
,
y
).
setUnite
(
new
Paysant
(
x
,
y
,
plateau
,
winner
));
//winner.ajoutUnit(plateau.getCase(x, y).getUnite());
Affichage
.
affichage
(
plateau
);
Affichage
.
affichage
(
plateau
);
//plateau.getCase(x, y).getUnite().move(deplacement());
while
(
y
<
30
)
{
System
.
out
.
println
(
winner
.
getArmee
().
get
(
0
));
winner
.
getArmee
().
get
(
0
).
move
(
deplacement
());
winner
.
getArmee
().
get
(
0
).
move
(
deplacement
());
System
.
out
.
println
(
'\n'
);
System
.
out
.
println
(
'\n'
);
Affichage
.
affichage
(
plateau
);
Affichage
.
affichage
(
plateau
);
}
Menu
();
Menu
();
}
}
public
static
void
Menu
()
{
public
static
void
Menu
()
{
System
.
out
.
print
(
"Bienvenu dans Game of Crown, vous êtes actuellement sur le Menu !"
);
System
.
out
.
print
(
"Bienvenu
e
dans Game of Crown, vous êtes actuellement sur le Menu !"
);
}
}
<<<<<<<
HEAD
public
Joueur
Game
(
Joueur
[]
joueurs
)
{
=======
public
static
char
deplacement
()
{
public
static
char
deplacement
()
{
Scanner
sc
=
new
Scanner
(
System
.
in
);
Scanner
sc
=
new
Scanner
(
System
.
in
);
System
.
out
.
println
(
"Veuillez choisir une direction"
);
System
.
out
.
println
(
"Veuillez choisir une direction"
);
...
@@ -50,7 +45,6 @@ public class Main {
...
@@ -50,7 +45,6 @@ public class Main {
}
}
private
Joueur
Game
(
Joueur
[]
joueurs
)
{
private
Joueur
Game
(
Joueur
[]
joueurs
)
{
>>>>>>>
Maxime
boolean
gameEnd
=
false
;
boolean
gameEnd
=
false
;
while
(
gameEnd
){
while
(
gameEnd
){
for
(
Joueur
currentPlayer
:
joueurs
)
{
for
(
Joueur
currentPlayer
:
joueurs
)
{
...
...
This diff is collapsed.
Click to expand it.
src/units/Unite.java
+
10
−
1
View file @
2d92f8ef
package
units
;
package
units
;
import
items.Items
;
import
items.Items
;
import
main.Affichage
;
import
main.Case
;
import
main.Case
;
import
main.Event
;
import
main.Event
;
import
main.Joueur
;
import
main.Joueur
;
...
@@ -118,7 +119,7 @@ public abstract class Unite {
...
@@ -118,7 +119,7 @@ public abstract class Unite {
}
}
if
(
this
.
plateau
.
getCase
(
x
,
y
).
getEvent
()
==
Event
.
FORT
)
{
if
(
this
.
plateau
.
getCase
(
x
,
y
).
getEvent
()
==
Event
.
FORT
)
{
this
.
plateau
.
getRegion
(
x
,
y
).
setProprietaire
(
joueur
);
this
.
plateau
.
getRegion
(
x
,
y
).
setProprietaire
(
joueur
);
//
this.joueur.getRoyaume().add(this.plateau.getRegion(x, y));
this
.
joueur
.
getRoyaume
().
add
(
this
.
plateau
.
getRegion
(
x
,
y
));
}
}
return
true
;
return
true
;
}
}
...
@@ -129,24 +130,32 @@ public abstract class Unite {
...
@@ -129,24 +130,32 @@ public abstract class Unite {
if
(
c
==
's'
)
{
if
(
c
==
's'
)
{
if
(
updatePosition
(
x
+
1
,
y
))
{
if
(
updatePosition
(
x
+
1
,
y
))
{
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setType
(
Type
.
GRASS
);
this
.
x
+=
1
;
return
true
;
return
true
;
}
}
}
}
else
if
(
c
==
'd'
)
{
else
if
(
c
==
'd'
)
{
if
(
updatePosition
(
x
,
y
+
1
))
{
if
(
updatePosition
(
x
,
y
+
1
))
{
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setType
(
Type
.
GRASS
);
this
.
y
+=
1
;
return
true
;
return
true
;
}
}
}
}
else
if
(
c
==
'q'
)
{
else
if
(
c
==
'q'
)
{
if
(
updatePosition
(
x
,
y
-
1
))
{
if
(
updatePosition
(
x
,
y
-
1
))
{
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setType
(
Type
.
GRASS
);
this
.
y
-=
1
;
return
true
;
return
true
;
}
}
}
}
else
if
(
c
==
'z'
)
{
else
if
(
c
==
'z'
)
{
if
(
updatePosition
(
x
-
1
,
y
))
{
if
(
updatePosition
(
x
-
1
,
y
))
{
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setUnite
(
null
);
this
.
plateau
.
getCase
(
x
,
y
).
setType
(
Type
.
GRASS
);
this
.
x
-=
1
;
return
true
;
return
true
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment