Skip to content
Snippets Groups Projects
Commit 182740c7 authored by Francois DEROUBAIX's avatar Francois DEROUBAIX
Browse files

update

parent 0ce40ed9
Branches
No related tags found
No related merge requests found
......@@ -17,36 +17,24 @@ public class Main {
}*/
Plateau plateau = new Plateau();
<<<<<<< HEAD
int x = 11;
int y = 10;
=======
int x = 11;
int y = 10;
>>>>>>> master
plateau.getCase(x, y).setUnite(new Paysant(x, y, plateau, winner));
Affichage.affichage(plateau);
while(y<30) {
winner.getArmee().get(0).move(deplacement());
System.out.println('\n');
<<<<<<< HEAD
winner.getArmee().get(0).teleporte();
=======
>>>>>>> master
Affichage.affichage(plateau);
}
Menu();
<<<<<<< HEAD
plateau.getCase(12, 0);
Affichage.affichage(plateau);
//Menu();
=======
plateau.getCase(12, 0);
Affichage.affichage(plateau);
>>>>>>> master
}
public static void Menu () {
......
package units;
import java.util.Random;
import items.Items;
import main.Affichage;
import main.Case;
import main.Direction;
import main.Event;
import main.Joueur;
import main.Plateau;
......@@ -31,6 +33,7 @@ public abstract class Unite {
this.x = x;
this.y = y;
this.joueur = joueur;
this.joueur.ajoutUnit(this);
this.item = null;
this.vision = vision;
}
......@@ -115,17 +118,12 @@ public abstract class Unite {
if(x>=0 && x<plateau.getPlateau().length*plateau.getRegion(0, 0).region.length && y>=0 && y<plateau.getPlateau().length*plateau.getRegion(0, 0).region.length ) {
this.plateau.getCase(x, y).setUnite(this);
this.plateau.getCase(x, y).setType(Type.UNITE);
return true;
}
return false;
}
//à voir le type
<<<<<<< HEAD
public boolean move(Direction d) {
if(d == Direction.BAS) {
if (updatePosition(x+1,y)) {
this.plateau.getCase(x, y).setUnite(null);
=======
public boolean move(char c) {
/*if(c=='s' && updatePosition(x+1,y))*/
......@@ -137,43 +135,33 @@ public abstract class Unite {
this.plateau.getCase(x, y).setUnite(null);
this.plateau.getCase(x, y).setType(Type.GRASS);
this.x+=1;
>>>>>>> master
updateDecouverte(this.plateau.getCase(x+1, y), this.vision);
return true;
}
}
else if(d == Direction.DROITE) {
else if(c == 'd') {
if (updatePosition(x,y+1)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
=======
this.plateau.getCase(x, y).setType(Type.GRASS);
this.y+=1;
>>>>>>> master
updateDecouverte(this.plateau.getCase(x, y+1), this.vision);
return true;
}
}
else if(d == Direction.GAUCHE) {
else if(c == 'q') {
if (updatePosition(x,y-1)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
=======
this.plateau.getCase(x, y).setType(Type.GRASS);
this.y-=1;
>>>>>>> master
updateDecouverte(this.plateau.getCase(x, y-1), this.vision);
return true;
}
}
else if(d == Direction.HAUT) {
else if(c == 'z') {
if (updatePosition(x-1, y)) {
this.plateau.getCase(x, y).setUnite(null);
<<<<<<< HEAD
=======
this.plateau.getCase(x, y).setType(Type.GRASS);
this.x-=1;
>>>>>>> master
updateDecouverte(this.plateau.getCase(x-1, y), this.vision);
return true;
}
......@@ -181,8 +169,6 @@ public abstract class Unite {
return false;
}
<<<<<<< HEAD
=======
public void teleporte() {
Random alea = new Random();
int longueur = plateau.getPlateau().length*plateau.getRegion(0, 0).region.length;
......@@ -199,7 +185,6 @@ public abstract class Unite {
this.x=rd1;
this.y=rd2;
}
>>>>>>> master
public void updateDecouverte (Case emplacement, int vision) {
System.out.println("" + emplacement.getX() + ", " + emplacement.getY());
if (emplacement.getX()+1 < this.plateau.getLength()) {
......@@ -235,10 +220,6 @@ public abstract class Unite {
}
}
}
<<<<<<< HEAD
=======
>>>>>>> master
public abstract String toString();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment