8081828384858687888990
private MazeSpace createSpace(char symbol, int x, int y){ MazeSpace result = new MazeSpace(x, y); switch (symbol) { case 'W': result.setDecoration(new MazeWall()); break; } return result; }
505152535455565758
int x = (int)(Math.random() * parameters.getWidth()); space = maze.getSpace(x, y); } while ((space.getDecoration() != null && space.getDecoration() instanceof MazeWall)); space.setDecoration(new MazeWall()); wallsSetted ++; } }
373839404142434445464748
while(alive){ try { Thread.sleep(getNextInterval()); if (running){ if (walls.size() > 0){ MazeWall wall = walls.get(getNextWallIndex()); wall.setAllowsPassage(!wall.allowsPassage()); } } } catch (InterruptedException e) { e.printStackTrace(); }