Cleaning up the code. Many, many things are left.
authorgumartinm <gu.martinm@gmail.com>
Sun, 6 Nov 2011 23:24:20 +0000 (00:24 +0100)
committergumartinm <gu.martinm@gmail.com>
Sun, 6 Nov 2011 23:24:20 +0000 (00:24 +0100)
Step by step I will get the goal, my first Tetris in Android  :)

AndroidTetris/src/de/android/androidtetris/DrawView.java
AndroidTetris/src/de/android/androidtetris/Piece.java

index 97297d6..c51d0f2 100644 (file)
@@ -34,38 +34,43 @@ public class DrawView extends SurfaceView {
     Piece prePiece;
     Piece currentPiece;
        
-       class AndroidTetrisThread extends Thread {
+       class AndroidTetrisThread extends Thread 
+       {
                private DrawView view;
 
-              private boolean running = false;
+           private boolean running = false;
 
-              public AndroidTetrisThread(DrawView view) {
-                    this.view = view;
-              }
+        
+           public AndroidTetrisThread(DrawView view) {
+               this.view = view;
+           }
 
-              public void setRunning(boolean run) {
-                    running = run;
-              }
+           
+           public void setRunning(boolean run) {
+               running = run;
+           }
 
-        
-              @Override
-              public void run() {
-                    while (running) {
-                           Canvas c = null;
-                           try {
-                                  c = view.getHolder().lockCanvas();
-                                  synchronized (view.getHolder()) {
-                                          view.move(0, 1);
-                                          view.drawMap(c);
-                                          //view.onDraw(c);
-                                  }
-                           } finally {
-                                  if (c != null) {
-                                         view.getHolder().unlockCanvasAndPost(c);
-                                  }
-                           }
-                    }
-              }
+           
+           @Override
+           public void run() 
+           {
+               while (running) 
+               {
+                       Canvas c = null;
+                   try {
+                       c = view.getHolder().lockCanvas();
+                       synchronized (view.getHolder()) 
+                       {
+                               view.move(0, 1);
+                           view.drawMap(c);
+                           //view.onDraw(c);
+                       }
+                   }finally {
+                       if (c != null) 
+                               view.getHolder().unlockCanvasAndPost(c);
+                   }
+                }
+           }
        }
        
        /**
index a0c103a..a9c13f8 100644 (file)
@@ -85,9 +85,9 @@ public enum Piece {
        };
        
        
-       //Every is contained in a square. This is the square's width.
+       //Every piece is contained in a square. This is the square's width.
        private static final int WIDTH = 4;
-       //Every is contained in a square. This is the square's height.
+       //Every piece is contained in a square. This is the square's height.
        private static final int HEIGHT = 4;
        //Every piece is contained in a square.
        public Tile[][] size = new Tile[WIDTH][HEIGHT];