Revision: 5579
          http://jnode.svn.sourceforge.net/jnode/?rev=5579&view=rev
Author:   lsantha
Date:     2009-07-01 08:57:15 +0000 (Wed, 01 Jul 2009)

Log Message:
-----------
Various fixes.

Modified Paths:
--------------
    trunk/distr/src/apps/org/jnode/games/tetris/Tetris.java

Modified: trunk/distr/src/apps/org/jnode/games/tetris/Tetris.java
===================================================================
--- trunk/distr/src/apps/org/jnode/games/tetris/Tetris.java     2009-06-16 
22:22:58 UTC (rev 5578)
+++ trunk/distr/src/apps/org/jnode/games/tetris/Tetris.java     2009-07-01 
08:57:15 UTC (rev 5579)
@@ -377,14 +377,28 @@
                         }
                         if (hasRoom(bi, x, y + 1)) {
                             y++;
-                            SwingUtilities.invokeLater(runRepaint);
+                            try {
+                                SwingUtilities.invokeAndWait(runRepaint);
+                            } catch (InterruptedException x) {
+                                //ignore
+                            }
                         } else {
                             newBlock();
                             if (!hasRoom(bi, x, y)) {
                                 setUp(false);
                                 end = true;
-                                SwingUtilities.invokeLater(runRepaint);
+                                try {
+                                    SwingUtilities.invokeAndWait(runRepaint);
+                                } catch (InterruptedException x) {
+                                    //ignore
+                                }
+                                continue;
                             }
+                            try {
+                                SwingUtilities.invokeAndWait(runRepaint);
+                            } catch (InterruptedException x) {
+                                //ignore
+                            }
                         }
                         after = System.currentTimeMillis();
                         sleep = delay - (after - before);
@@ -440,6 +454,9 @@
                         WORLD[j][i - k] = WORLD[j][i - k - 1];
                     }
                 }
+                for (int j = 1; j < WIDTH_C + 1; j++) {
+                    WORLD[j][1] = 0;
+                }
             }
         }
         si = next_si;


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
_______________________________________________
Jnode-svn-commits mailing list
Jnode-svn-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jnode-svn-commits

Reply via email to