mirror of
https://github.com/Cpt-Adok/SNAKE.git
synced 2026-01-25 16:34:08 +00:00
correction de probleme et ajout d'un quick multi
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import connexion.Channel;
|
||||
import connexion.Reseau;
|
||||
import environnements.*;
|
||||
import game.Terminal;
|
||||
import personnages.*;
|
||||
@@ -11,14 +9,27 @@ public class Main {
|
||||
|
||||
Map map = new Map(20, 20);
|
||||
|
||||
Personnage[] personnages = new Personnage[] {
|
||||
new Player(new int[] {0, 0}, "Philippe Etchebest"),
|
||||
};
|
||||
// lancer en local
|
||||
if (args.length < 2) {
|
||||
Grid[][] grid = map.getGrid();
|
||||
|
||||
|
||||
// map.addObjects(Item.FRAISE, 0, 0);
|
||||
// map.addObjectsRandomize(new Item[] {Item.FRAISE}, 1);
|
||||
Personnage[] personnages = new Personnage[] {
|
||||
new Player(new int[] {0, 0}, "Philippe Etchebest"),
|
||||
new Player(new int[] {grid[0].length - 1, grid.length - 1}, "Luke Skywalker")
|
||||
};
|
||||
|
||||
new Terminal(map, personnages).run("channel129", "channel128");
|
||||
map.addObjects(Item.FRAISE, 3, 5);
|
||||
map.addObjectsRandomize(new Item[] {Item.FRAISE, Item.WALL}, 3);
|
||||
|
||||
new Terminal(map, personnages).run();
|
||||
}
|
||||
// lancer en ligne
|
||||
else {
|
||||
Personnage[] personnages = new Personnage[] {
|
||||
new Player(new int[] {0, 0}, "Philippe Etchebest"),
|
||||
};
|
||||
|
||||
new Terminal(map, personnages).run(args[0], args[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package connexion;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import environnements.*;
|
||||
import types.Item;
|
||||
import types.Mouvement;
|
||||
import personnages.Personnage;
|
||||
|
||||
@@ -12,12 +9,9 @@ public class Channel extends Personnage {
|
||||
private static Reseau adversaire;
|
||||
private String channel;
|
||||
|
||||
private Map map;
|
||||
|
||||
public Channel(Map map, String channel, String autreChannel) {
|
||||
super(new int [] {map.getGrid()[0].length - 1, map.getGrid().length - 1});
|
||||
|
||||
this.map = map;
|
||||
this.name = autreChannel;
|
||||
|
||||
this.channel = channel;
|
||||
|
||||
Reference in New Issue
Block a user