Skip to content
Snippets Groups Projects
Commit 2d92f8ef authored by Maxime Wallart's avatar Maxime Wallart :speech_balloon:
Browse files

update mouvement

parent 8b13ccdf
No related branches found
No related tags found
No related merge requests found
...@@ -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("Bienvenue 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) {
......
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;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment