mirror of
https://github.com/Cpt-Adok/SNAKE.git
synced 2026-01-25 06:34:06 +00:00
ajout de Effects et Item
This commit is contained in:
@@ -1,26 +0,0 @@
|
||||
package Environnements;
|
||||
|
||||
public class Map {
|
||||
public static int[][] grille;
|
||||
|
||||
public static int[][] generateMap(int hauteur, int largueur) {
|
||||
int[][] generateGrille = new int[hauteur][largueur];
|
||||
int j;
|
||||
|
||||
for(int i = 0; i<generateGrille.length; i++) {
|
||||
for(j = 0; j<generateGrille[0].length; i++) {
|
||||
if (i == 0 || i == generateGrille.length-1) {
|
||||
generateGrille[i][j] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (j == 0 || j == generateGrille[i].length-1) {
|
||||
generateGrille[i][0] = 1;
|
||||
generateGrille[i][generateGrille[i].length - 1] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
grille = generateGrille;
|
||||
return generateGrille;
|
||||
}
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
package Environnements;
|
||||
|
||||
public class Wall {
|
||||
|
||||
}
|
||||
29
src/Item/Effects.java
Normal file
29
src/Item/Effects.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package Item;
|
||||
|
||||
/**
|
||||
* <p>Ceci est l'enumération où il y aura tout les effets disponible dans le projet.
|
||||
*/
|
||||
public enum Effects {
|
||||
/**
|
||||
* <p>pouvoir faire un dash de 4 ligne pendant le round prochain après
|
||||
* la recupération.
|
||||
*/
|
||||
POWER,
|
||||
|
||||
/**
|
||||
* <p> Modifie la valeur de N pendant 2 tours en le multipliant par 2
|
||||
* <p> <strong>Exemple : </strong> si N = 2, il va être *2 donc N sera
|
||||
* egal à 4 et le prochain tour quand N = 3, il sera égal à 6.
|
||||
*/
|
||||
BOOST,
|
||||
|
||||
/**
|
||||
* <p>pouvoir etre invincible pendant le prochain round.
|
||||
*/
|
||||
INVINCIBILITY,
|
||||
|
||||
/**
|
||||
* <p> impossible à passer à travers.
|
||||
*/
|
||||
IMPASSABLE;
|
||||
}
|
||||
29
src/Item/Item.java
Normal file
29
src/Item/Item.java
Normal file
@@ -0,0 +1,29 @@
|
||||
package Item;
|
||||
|
||||
/**
|
||||
* Cette enumération contient tout les items à effets disponnible dans le jeu.
|
||||
*/
|
||||
public enum Item {
|
||||
Mur("mur", Effects.IMPASSABLE),
|
||||
|
||||
FRAISE("fraise", Effects.INVINCIBILITY),
|
||||
ORANGE("orange", Effects.POWER),
|
||||
BANANE("banane", Effects.BOOST);
|
||||
|
||||
private final String nom;
|
||||
private final Effects effect;
|
||||
|
||||
Item(String nom, Effects effects) {
|
||||
this.nom = nom;
|
||||
this.effect = effects;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.nom;
|
||||
}
|
||||
|
||||
public Effects getEffects() {
|
||||
return effect;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import Environnements.Map;
|
||||
import Personnages.*;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package Personnages;
|
||||
|
||||
public class Characters {
|
||||
protected int[] coordinate;
|
||||
public static int size; // N
|
||||
|
||||
public static void setSize(int s) {
|
||||
size = s;
|
||||
}
|
||||
|
||||
public int[] getCoordinate() {
|
||||
return this.coordinate;
|
||||
}
|
||||
|
||||
public int getSize() {
|
||||
return size;
|
||||
}
|
||||
}
|
||||
5
src/personnages/Personnage.java
Normal file
5
src/personnages/Personnage.java
Normal file
@@ -0,0 +1,5 @@
|
||||
package Personnages;
|
||||
|
||||
public class Personnage {
|
||||
|
||||
}
|
||||
@@ -1,11 +1,5 @@
|
||||
package Personnages;
|
||||
|
||||
public class Player extends Characters {
|
||||
public Player() {
|
||||
|
||||
}
|
||||
|
||||
public Integer[] changeCoordinate() {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package Personnages;
|
||||
|
||||
public class Robot extends Characters {
|
||||
public Robot() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user