Commit aa403564 authored by Lucas Delcros's avatar Lucas Delcros

Temporary solution to spawning in lava bug : the player spawns in the upper left corner

parent 45ab6380
...@@ -31,10 +31,10 @@ public class SurfacesMapGeneration implements Serializable{ ...@@ -31,10 +31,10 @@ public class SurfacesMapGeneration implements Serializable{
private static MapPoint defineStartPosition(Surface[] rooms) { private static MapPoint defineStartPosition(Surface[] rooms) {
Random r = new Random(); Random r = new Random();
int idRoom=r.nextInt(rooms.length); int idRoom=r.nextInt(rooms.length);
int posY=(rooms[idRoom].j1+rooms[idRoom].j2)/2; //int posY=(rooms[idRoom].j1+rooms[idRoom].j2)/2;
int posX=(rooms[idRoom].i1+rooms[idRoom].i2)/2; //int posX=(rooms[idRoom].i1+rooms[idRoom].i2)/2;
// int posX = rooms[idRoom].j1; int posX = rooms[idRoom].i1;
// int posY = rooms[idRoom].i1; int posY = rooms[idRoom].j1;
MapPoint startPosition=new MapPoint(posY, posX); MapPoint startPosition=new MapPoint(posY, posX);
return startPosition; return startPosition;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment