Commits

Meitian Huang  committed 27006a4

Formate...

  • Participants
  • Parent commits 587b4bb

Comments (0)

Files changed (6)

File src/Game/Ball.java

         ball.setLinearVelocity(Vector3f.ZERO);
     }
 
-    public void pause(){
+    public void pause() {
         ball.setKinematic(true);
         ball.setKinematicSpatial(true);
     }
 
-    public void resume(){
+    public void resume() {
         ball.setKinematic(false);
         ball.setKinematicSpatial(false);
     }

File src/Game/Cell.java

      * There are two types of walls: normal walls and borders.
      * Normal walls are those that can be pushed down.
      * Borders are the border of the board, which cannot be pushed down.
-     *
+     * <p/>
      * Initially, every cell has four normal walls, W, S, E, and N.
-     *
+     * <p/>
      * Some of these may be changed to borders depending on the position of the
      * cell on the board.
-     *
+     * <p/>
      * If the cell is the leftmost cell in a row, it has a 'W' border.
      * If the cell is the topmost cell in a column, it has a 'N' border.
      * etc.

File src/Game/DFS.java

         for (int i = 0; i < height; i++) {
             for (int j = 0; j < width; j++) {
                 grid[i][j] = new Cell(j, i, width, height);
-                grid[i][j].setSideLength(unit*2);
+                grid[i][j].setSideLength(unit * 2);
 //                The index of the central cell is i = level, j = level + 1
                 grid[i][j].setScreenCoord(i, j, level, level + 1);
             }
 
     /**
      * Generates a random maze.
-     *
+     * <p/>
      * Randomly picks an adjacent cell and moves to it.
-     *
+     * <p/>
      * It will move if:
      * 1. The move will not be out-of-range.
      * 2. the cell to which it moves has not been visited.
      *
      * @param cx x-coordinate of the cell from where the program starts to
-     * visit its adjacent cells.
+     *           visit its adjacent cells.
      * @param cy y-coordinate of the cell from where the program starts to
-     * visit its adjacent cells.
+     *           visit its adjacent cells.
      */
     public void visitFrom(int cx, int cy) {
         Collections.shuffle(directions);

File src/Game/Handler.java

      * Add a cylinder to the base of the board.
      *
      * @param cylinderShape
-     * @param location The location where the cylinder should be attached.
+     * @param location      The location where the cylinder should be attached.
      */
     public void addToBase(CylinderCollisionShape cylinderShape,
                           Vector3f location);

File src/Game/Hole.java

                 new CylinderCollisionShape(
                         new Vector3f(
                                 radius,
-                                handler.getBoardThickness()/2,
+                                handler.getBoardThickness() / 2,
                                 0.1f),
                         1); // The mass of the ball is set to 1.
         handler.addToBase(cylinderCollisionShape, location);
 
     /**
      * Determines if the hole collides with the ball.
-     *
+     * <p/>
      * Note:
      * The ball collides with the hole if the distance between their centres
      * is less than a certain value AND the magnitude of the linear speed of
      *
      * @param ball The ball being tested for.
      * @return True if the ball is too close to the hole and the speed of the
-     * ball is too small.
+     *         ball is too small.
      */
     public boolean collideWith(Ball ball) {
         return location.distance(ball.getPhysicsLocation()) < threshold

File src/Game/Score.java

     /**
      * Reduces the score by n and terminates the game if the score is less
      * than 0.
+     *
      * @param n
      */
     public void reduceScore(int n) {