Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
mohamedlouay committed May 6, 2021
1 parent 814edde commit 6c53c34
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 12 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified out/artifacts/Rogue_like_jar/Rogue-like.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions src/main/java/GameSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ public class GameSystem {



public int lignes =25;
public int colonnes =150 ;
public int lignes =20;
public int colonnes =80 ;
Scanner scanner = new Scanner(System.in);

public GameSystem()
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/World.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private void tryMoveEnemy (int targetX ,int targetY,Enemy enemy,Player player)
}
default: {

battleEnemey(player ,targetX,targetY ) ;// battle with the player
break;

}

Expand Down
13 changes: 5 additions & 8 deletions src/main/java/generationProcedurale/ConstructeurDuMonde.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public class ConstructeurDuMonde {
Tile[][] tiles;
int lignes;
int colonnes;
private int maxRooms = 20;
private int maxRooms = 4;
private int maxRoomSize = 10;
private int minRoomSize = 5;
Random random = new Random();
Expand All @@ -27,9 +27,6 @@ public class ConstructeurDuMonde {
public ConstructeurDuMonde(Player player, int lignes, int colonnes) {
this.lignes = lignes;
this.colonnes = colonnes;
this.maxRooms = maxRooms;
this.maxRoomSize = maxRoomSize;
this.minRoomSize = minRoomSize;
tiles = create(lignes, colonnes);
placeRooms();
initPlayerPosition(player);
Expand Down Expand Up @@ -149,10 +146,10 @@ public void placeRooms() {
int i = 0;
while (i < maxRooms && nbTry < 1000) {
nbTry++;
int w = minRoomSize + random.nextInt(maxRoomSize - minRoomSize + 1) + 10;
int w = minRoomSize + random.nextInt(maxRoomSize - minRoomSize + 1)+5 ;
int h = minRoomSize + random.nextInt(maxRoomSize - minRoomSize + 1);
int x = random.nextInt(colonnes - w - 1) + 1;
int y = random.nextInt(lignes - h - 1 - 10) + 1;
int y = random.nextInt(lignes - h - 1) + 1;

// create room with randomized values
Room newRoom = new Room(x, y, w, h);
Expand Down Expand Up @@ -249,7 +246,7 @@ public void initEnemiesPosition(Player player) {
int level = player.getLevel();
for (Room r : rooms) {

int nbrEnemyPerRoom = random.nextInt(level + 3);//nombre d'ennemies dans une salle est proportionnel au level de player
int nbrEnemyPerRoom = random.nextInt(level + 1);//nombre d'ennemies dans une salle est proportionnel au level de player
int nbEnemy = 1;
while (nbEnemy <= nbrEnemyPerRoom) {
nbEnemy++;
Expand Down Expand Up @@ -308,7 +305,7 @@ public void initItemsPosition(Player player) {


for (Room r : rooms) {
int nbrItemPerRoom = random.nextInt(level + 3);//nombre items dans une salle est proportionnel au level de player
int nbrItemPerRoom = random.nextInt(level + 1);//nombre items dans une salle est proportionnel au level de player
int nbItem = 1;
while (nbItem <= nbrItemPerRoom) {
nbItem++;
Expand Down

0 comments on commit 6c53c34

Please sign in to comment.