home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 64 / CDPRO64.iso / JUEGOS / java / tobitris / tobitris.jar / tetris_std / maingame.class (.txt) < prev    next >
Encoding:
Java Class File  |  2005-06-27  |  13.9 KB  |  690 lines

  1. package tetris_std;
  2.  
  3. import java.util.Random;
  4. import java.util.Timer;
  5. import java.util.TimerTask;
  6. import javax.microedition.lcdui.Canvas;
  7. import javax.microedition.lcdui.Font;
  8. import javax.microedition.lcdui.Graphics;
  9. import javax.microedition.lcdui.Image;
  10.  
  11. public class maingame extends Canvas {
  12.    private int width;
  13.    private int height;
  14.    private int scaler;
  15.    private int yoffset;
  16.    private int xoffset;
  17.    private int[][] tetrismat;
  18.    private int level = 1;
  19.    private int reihen = 10;
  20.    private int points;
  21.    private int allreihen = 0;
  22.    // $FF: renamed from: x int
  23.    private int field_0 = 0;
  24.    // $FF: renamed from: y int
  25.    private int field_1 = 0;
  26.    private int clipwidth;
  27.    private int clipheight;
  28.    private int ystart;
  29.    private int yende;
  30.    private int xstart;
  31.    private int xende;
  32.    private int fontxoffset;
  33.    private stein stein;
  34.    private TimerTask timertask = new timertask(this);
  35.    private Timer timer = new Timer();
  36.    private Random random = new Random();
  37.    private static final int XLENGHT = 11;
  38.    private static final int YLENGHT = 21;
  39.    private static final int WAND = 88;
  40.    private static final int BODEN = 77;
  41.    private static final int XSTARTPOS = 6;
  42.    private static final int YSTARTPOS = 1;
  43.    private static final int STARTREIHEN = 10;
  44.    private static final int STARTLEVEL = 1;
  45.    private static final int anker = 20;
  46.    private boolean paintall = true;
  47.    private boolean firstpaint = true;
  48.    private boolean steindown = false;
  49.    private boolean steindown2 = false;
  50.    private boolean asleep = false;
  51.    private boolean gostatus = false;
  52.    private static final Font font = Font.getFont(64, 0, 8);
  53.    private Image dbuffer;
  54.    private Graphics myg;
  55.  
  56.    public void start() {
  57.       this.setFullScreenMode(true);
  58.       this.width = this.getWidth();
  59.       this.height = this.getHeight();
  60.       this.scaler = this.height / 21;
  61.       this.dbuffer = Image.createImage(this.width, this.height);
  62.       this.myg = this.dbuffer.getGraphics();
  63.       this.scaler = this.height / 21;
  64.       this.fontxoffset = this.xoffset + this.scaler * 11;
  65.       this.xoffset = 2;
  66.       this.yoffset = 0;
  67.       this.stein = new stein(this.scaler);
  68.       this.clipwidth = 6 * this.scaler + 3;
  69.       this.clipheight = 6 * this.scaler + 3;
  70.       this.fillmatrix();
  71.       this.stein.neuerstein(6, 1);
  72.       this.changematrix(this.stein);
  73.       this.zeichnen();
  74.       this.timer.schedule(this.timertask, 450L, 450L);
  75.    }
  76.  
  77.    protected void keyPressed(int keyCode) {
  78.       if (!this.asleep) {
  79.          switch (this.getGameAction(keyCode)) {
  80.             case 1:
  81.                this.stein.rotate(1);
  82.                this.changematrix(this.stein);
  83.                this.zeichnen();
  84.                break;
  85.             case 2:
  86.                this.stein.movelinks(1);
  87.                this.changematrix(this.stein);
  88.                this.zeichnen();
  89.             case 3:
  90.             case 4:
  91.             default:
  92.                break;
  93.             case 5:
  94.                this.stein.moverechts(1);
  95.                this.changematrix(this.stein);
  96.                this.zeichnen();
  97.                break;
  98.             case 6:
  99.                this.stein.movedown(1);
  100.  
  101.                while(this.changematrix(this.stein)) {
  102.                   this.stein.movedown(1);
  103.                }
  104.  
  105.                this.zeichnen();
  106.          }
  107.       }
  108.  
  109.    }
  110.  
  111.    private synchronized boolean changematrix(stein stein) {
  112.       if (!this.steincheck(stein.gety(), stein.getx(), stein.getrot(), stein.gettyp() + 10, 0, stein.gettyp())) {
  113.          this.paintall = false;
  114.          this.steincheck(stein.getoldy(), stein.getoldx(), stein.getoldrot(), 0, 1, stein.gettyp());
  115.          this.steincheck(stein.gety(), stein.getx(), stein.getrot(), stein.gettyp() + 10, 1, stein.gettyp());
  116.          stein.backupxyr();
  117.          return true;
  118.       } else {
  119.          if (!this.steincheck(stein.getoldy() + 1, stein.getoldx(), stein.getoldrot(), stein.gettyp() + 10, 0, stein.gettyp())) {
  120.             this.paintall = false;
  121.             this.steincheck(stein.getoldy(), stein.getoldx(), stein.getoldrot(), stein.gettyp() + 10, 1, stein.gettyp());
  122.             stein.setbackxyr();
  123.          } else if (stein.getrot() == stein.getoldrot()) {
  124.             this.paintall = true;
  125.             this.steincheck(stein.getoldy(), stein.getoldx(), stein.getoldrot(), stein.gettyp() + 20, 1, stein.gettyp());
  126.  
  127.             for(int i = 0; i < 11; ++i) {
  128.                if (this.tetrismat[2][i] > 20 && this.tetrismat[2][i] != 88) {
  129.                   this.levelstate(true);
  130.                }
  131.             }
  132.  
  133.             this.droprow();
  134.             stein.neuerstein(6, 1);
  135.             this.steindown = true;
  136.             if (this.changematrix(stein)) {
  137.                ++this.points;
  138.             }
  139.          } else {
  140.             this.paintall = false;
  141.             this.steincheck(stein.getoldy(), stein.getoldx(), stein.getoldrot(), stein.gettyp() + 10, 1, stein.gettyp());
  142.             stein.setbackxyr();
  143.          }
  144.  
  145.          return false;
  146.       }
  147.    }
  148.  
  149.    private boolean steincheck(int y, int x, int drehung, int pattern, int doit, int typ) {
  150.       switch (typ) {
  151.          case 1:
  152.             switch (drehung) {
  153.                case 0:
  154.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y + 1][x - 1] <= 20) {
  155.                      if (doit == 1) {
  156.                         this.tetrismat[y][x] = pattern;
  157.                         this.tetrismat[y][x - 1] = pattern;
  158.                         this.tetrismat[y + 1][x] = pattern;
  159.                         this.tetrismat[y + 1][x - 1] = pattern;
  160.                      }
  161.  
  162.                      return false;
  163.                   }
  164.  
  165.                   return true;
  166.                default:
  167.                   return true;
  168.             }
  169.          case 2:
  170.             switch (drehung) {
  171.                case 0:
  172.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y + 1][x + 1] <= 20) {
  173.                      if (doit == 1) {
  174.                         this.tetrismat[y][x] = pattern;
  175.                         this.tetrismat[y][x - 1] = pattern;
  176.                         this.tetrismat[y + 1][x] = pattern;
  177.                         this.tetrismat[y + 1][x + 1] = pattern;
  178.                      }
  179.  
  180.                      return false;
  181.                   }
  182.  
  183.                   return true;
  184.                case 1:
  185.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y - 1][x + 1] <= 20 && this.tetrismat[y][x + 1] <= 20) {
  186.                      if (doit == 1) {
  187.                         this.tetrismat[y][x] = pattern;
  188.                         this.tetrismat[y + 1][x] = pattern;
  189.                         this.tetrismat[y - 1][x + 1] = pattern;
  190.                         this.tetrismat[y][x + 1] = pattern;
  191.                      }
  192.  
  193.                      return false;
  194.                   }
  195.  
  196.                   return true;
  197.                default:
  198.                   return true;
  199.             }
  200.          case 3:
  201.             switch (drehung) {
  202.                case 0:
  203.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y + 1][x - 1] <= 20) {
  204.                      if (doit == 1) {
  205.                         this.tetrismat[y][x] = pattern;
  206.                         this.tetrismat[y][x - 1] = pattern;
  207.                         this.tetrismat[y][x + 1] = pattern;
  208.                         this.tetrismat[y + 1][x - 1] = pattern;
  209.                      }
  210.  
  211.                      return false;
  212.                   }
  213.  
  214.                   return true;
  215.                case 1:
  216.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y - 1][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y + 1][x + 1] <= 20) {
  217.                      if (doit == 1) {
  218.                         this.tetrismat[y][x] = pattern;
  219.                         this.tetrismat[y - 1][x] = pattern;
  220.                         this.tetrismat[y + 1][x] = pattern;
  221.                         this.tetrismat[y + 1][x + 1] = pattern;
  222.                      }
  223.  
  224.                      return false;
  225.                   }
  226.  
  227.                   return true;
  228.                case 2:
  229.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y - 1][x + 1] <= 20) {
  230.                      if (doit == 1) {
  231.                         this.tetrismat[y][x] = pattern;
  232.                         this.tetrismat[y][x - 1] = pattern;
  233.                         this.tetrismat[y][x + 1] = pattern;
  234.                         this.tetrismat[y - 1][x + 1] = pattern;
  235.                      }
  236.  
  237.                      return false;
  238.                   }
  239.  
  240.                   return true;
  241.                case 3:
  242.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y - 1][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y - 1][x - 1] <= 20) {
  243.                      if (doit == 1) {
  244.                         this.tetrismat[y][x] = pattern;
  245.                         this.tetrismat[y - 1][x] = pattern;
  246.                         this.tetrismat[y + 1][x] = pattern;
  247.                         this.tetrismat[y - 1][x - 1] = pattern;
  248.                      }
  249.  
  250.                      return false;
  251.                   }
  252.  
  253.                   return true;
  254.                default:
  255.                   return true;
  256.             }
  257.          case 4:
  258.             switch (drehung) {
  259.                case 0:
  260.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y + 1][x - 1] <= 20) {
  261.                      if (doit == 1) {
  262.                         this.tetrismat[y][x] = pattern;
  263.                         this.tetrismat[y][x + 1] = pattern;
  264.                         this.tetrismat[y + 1][x] = pattern;
  265.                         this.tetrismat[y + 1][x - 1] = pattern;
  266.                      }
  267.  
  268.                      return false;
  269.                   }
  270.  
  271.                   return true;
  272.                case 1:
  273.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y + 1][x + 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y - 1][x] <= 20) {
  274.                      if (doit == 1) {
  275.                         this.tetrismat[y][x] = pattern;
  276.                         this.tetrismat[y + 1][x + 1] = pattern;
  277.                         this.tetrismat[y][x + 1] = pattern;
  278.                         this.tetrismat[y - 1][x] = pattern;
  279.                      }
  280.  
  281.                      return false;
  282.                   }
  283.  
  284.                   return true;
  285.                default:
  286.                   return true;
  287.             }
  288.          case 5:
  289.             switch (drehung) {
  290.                case 0:
  291.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x - 2] <= 20 && this.tetrismat[y][x + 1] <= 20) {
  292.                      if (doit == 1) {
  293.                         this.tetrismat[y][x] = pattern;
  294.                         this.tetrismat[y][x - 1] = pattern;
  295.                         this.tetrismat[y][x - 2] = pattern;
  296.                         this.tetrismat[y][x + 1] = pattern;
  297.                      }
  298.  
  299.                      return false;
  300.                   }
  301.  
  302.                   return true;
  303.                case 1:
  304.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y + 2][x] <= 20 && this.tetrismat[y - 1][x] <= 20) {
  305.                      if (doit == 1) {
  306.                         this.tetrismat[y][x] = pattern;
  307.                         this.tetrismat[y + 1][x] = pattern;
  308.                         this.tetrismat[y + 2][x] = pattern;
  309.                         this.tetrismat[y - 1][x] = pattern;
  310.                      }
  311.  
  312.                      return false;
  313.                   }
  314.  
  315.                   return true;
  316.                default:
  317.                   return true;
  318.             }
  319.          case 6:
  320.             switch (drehung) {
  321.                case 0:
  322.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y + 1][x + 1] <= 20) {
  323.                      if (doit == 1) {
  324.                         this.tetrismat[y][x] = pattern;
  325.                         this.tetrismat[y][x - 1] = pattern;
  326.                         this.tetrismat[y][x + 1] = pattern;
  327.                         this.tetrismat[y + 1][x + 1] = pattern;
  328.                      }
  329.  
  330.                      return false;
  331.                   }
  332.  
  333.                   return true;
  334.                case 1:
  335.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y - 1][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y - 1][x + 1] <= 20) {
  336.                      if (doit == 1) {
  337.                         this.tetrismat[y][x] = pattern;
  338.                         this.tetrismat[y - 1][x] = pattern;
  339.                         this.tetrismat[y + 1][x] = pattern;
  340.                         this.tetrismat[y - 1][x + 1] = pattern;
  341.                      }
  342.  
  343.                      return false;
  344.                   }
  345.  
  346.                   return true;
  347.                case 2:
  348.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y - 1][x - 1] <= 20) {
  349.                      if (doit == 1) {
  350.                         this.tetrismat[y][x] = pattern;
  351.                         this.tetrismat[y][x - 1] = pattern;
  352.                         this.tetrismat[y][x + 1] = pattern;
  353.                         this.tetrismat[y - 1][x - 1] = pattern;
  354.                      }
  355.  
  356.                      return false;
  357.                   }
  358.  
  359.                   return true;
  360.                case 3:
  361.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y - 1][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y + 1][x - 1] <= 20) {
  362.                      if (doit == 1) {
  363.                         this.tetrismat[y][x] = pattern;
  364.                         this.tetrismat[y - 1][x] = pattern;
  365.                         this.tetrismat[y + 1][x] = pattern;
  366.                         this.tetrismat[y + 1][x - 1] = pattern;
  367.                      }
  368.  
  369.                      return false;
  370.                   }
  371.  
  372.                   return true;
  373.                default:
  374.                   return true;
  375.             }
  376.          case 7:
  377.             switch (drehung) {
  378.                case 0:
  379.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y + 1][x] <= 20) {
  380.                      if (doit == 1) {
  381.                         this.tetrismat[y][x] = pattern;
  382.                         this.tetrismat[y][x - 1] = pattern;
  383.                         this.tetrismat[y][x + 1] = pattern;
  384.                         this.tetrismat[y + 1][x] = pattern;
  385.                      }
  386.  
  387.                      return false;
  388.                   }
  389.  
  390.                   return true;
  391.                case 1:
  392.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y - 1][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y][x + 1] <= 20) {
  393.                      if (doit == 1) {
  394.                         this.tetrismat[y][x] = pattern;
  395.                         this.tetrismat[y - 1][x] = pattern;
  396.                         this.tetrismat[y + 1][x] = pattern;
  397.                         this.tetrismat[y][x + 1] = pattern;
  398.                      }
  399.  
  400.                      return false;
  401.                   }
  402.  
  403.                   return true;
  404.                case 2:
  405.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y][x - 1] <= 20 && this.tetrismat[y][x + 1] <= 20 && this.tetrismat[y - 1][x] <= 20) {
  406.                      if (doit == 1) {
  407.                         this.tetrismat[y][x] = pattern;
  408.                         this.tetrismat[y][x - 1] = pattern;
  409.                         this.tetrismat[y][x + 1] = pattern;
  410.                         this.tetrismat[y - 1][x] = pattern;
  411.                      }
  412.  
  413.                      return false;
  414.                   }
  415.  
  416.                   return true;
  417.                case 3:
  418.                   if (this.tetrismat[y][x] <= 20 && this.tetrismat[y - 1][x] <= 20 && this.tetrismat[y + 1][x] <= 20 && this.tetrismat[y][x - 1] <= 20) {
  419.                      if (doit == 1) {
  420.                         this.tetrismat[y][x] = pattern;
  421.                         this.tetrismat[y - 1][x] = pattern;
  422.                         this.tetrismat[y + 1][x] = pattern;
  423.                         this.tetrismat[y][x - 1] = pattern;
  424.                      }
  425.  
  426.                      return false;
  427.                   }
  428.  
  429.                   return true;
  430.             }
  431.       }
  432.  
  433.       return true;
  434.    }
  435.  
  436.    private void droprow() {
  437.       for(int y = 1; y < 21; ++y) {
  438.          boolean leerstelle = false;
  439.  
  440.          for(int x = 1; x < 11; ++x) {
  441.             if (this.tetrismat[y][x] == 0) {
  442.                leerstelle = true;
  443.             }
  444.          }
  445.  
  446.          if (!leerstelle) {
  447.             while(y > 1) {
  448.                leerstelle = false;
  449.  
  450.                for(int var4 = 0; var4 <= 11; ++var4) {
  451.                   this.tetrismat[y][var4] = this.tetrismat[y - 1][var4];
  452.                }
  453.  
  454.                --y;
  455.             }
  456.  
  457.             this.levelstate(false);
  458.  
  459.             for(int var5 = 0; var5 <= 11; ++var5) {
  460.                this.tetrismat[y][var5] = 0;
  461.             }
  462.  
  463.             for(y = 0; y <= 21; ++y) {
  464.                this.tetrismat[y][0] = 88;
  465.                this.tetrismat[y][11] = 88;
  466.             }
  467.  
  468.             this.droprow();
  469.          }
  470.       }
  471.  
  472.    }
  473.  
  474.    private void levelstate(boolean gameover) {
  475.       if (!gameover) {
  476.          if (this.reihen > 1) {
  477.             --this.reihen;
  478.             ++this.allreihen;
  479.          } else {
  480.             this.reihen = 10;
  481.             if (this.level < 9) {
  482.                ++this.level;
  483.                this.timertask.cancel();
  484.                this.timertask = new timertask(this);
  485.                switch (this.level) {
  486.                   case 2:
  487.                      this.timer.schedule(this.timertask, 0L, 350L);
  488.                      break;
  489.                   case 3:
  490.                      this.timer.schedule(this.timertask, 0L, 300L);
  491.                      break;
  492.                   case 4:
  493.                      this.timer.schedule(this.timertask, 0L, 270L);
  494.                      break;
  495.                   case 5:
  496.                      this.timer.schedule(this.timertask, 0L, 250L);
  497.                      break;
  498.                   case 6:
  499.                      this.timer.schedule(this.timertask, 0L, 230L);
  500.                      break;
  501.                   case 7:
  502.                      this.timer.schedule(this.timertask, 0L, 220L);
  503.                      break;
  504.                   case 8:
  505.                      this.timer.schedule(this.timertask, 0L, 210L);
  506.                      break;
  507.                   case 9:
  508.                      this.timer.schedule(this.timertask, 0L, 200L);
  509.                }
  510.             }
  511.          }
  512.       } else {
  513.          this.fillmatrix();
  514.          this.gostatus = true;
  515.          this.level = 1;
  516.          this.reihen = 10;
  517.          this.allreihen = 0;
  518.          this.points = 0;
  519.          this.gosleep();
  520.       }
  521.  
  522.    }
  523.  
  524.    private void fillmatrix() {
  525.       this.tetrismat = new int[22][12];
  526.  
  527.       for(int i = 0; i <= 21; ++i) {
  528.          for(int j = 0; j <= 11; ++j) {
  529.             this.tetrismat[21][11] = 0;
  530.          }
  531.       }
  532.  
  533.       for(int var3 = 0; var3 <= 11; ++var3) {
  534.          this.tetrismat[21][var3] = 77;
  535.       }
  536.  
  537.       for(int var4 = 0; var4 <= 21; ++var4) {
  538.          this.tetrismat[var4][0] = 88;
  539.          this.tetrismat[var4][11] = 88;
  540.       }
  541.  
  542.    }
  543.  
  544.    protected synchronized void paint(Graphics g) {
  545.       if (!this.paintall && !this.steindown) {
  546.          if (this.firstpaint) {
  547.             g.setClip(0, 0, this.width, this.height);
  548.             this.firstpaint = false;
  549.          } else {
  550.             this.field_0 = this.xoffset + (this.stein.getx() - 3) * this.scaler;
  551.             this.field_1 = this.yoffset + (this.stein.gety() - 3) * this.scaler;
  552.             g.setClip(this.field_0, this.field_1, this.clipwidth, this.clipheight);
  553.          }
  554.       } else {
  555.          g.setClip(this.xoffset + this.scaler, this.yoffset + this.scaler, this.width, this.height);
  556.          this.steindown = false;
  557.       }
  558.  
  559.       g.drawImage(this.dbuffer, 0, 0, 20);
  560.    }
  561.  
  562.    private synchronized void zeichnen() {
  563.       this.myg.setColor(16777215);
  564.       this.myg.fillRect(0, 0, this.width, this.height);
  565.       if (this.asleep && !this.gostatus) {
  566.          try {
  567.             Image picpause = Image.createImage("/tetris_std/paused.png");
  568.             this.myg.drawImage(picpause, (this.width - picpause.getWidth()) / 2, (this.height - picpause.getHeight()) / 2, 20);
  569.          } catch (Exception var4) {
  570.             this.myg.drawString("- Pause -", this.width / 2, this.height / 2, 20);
  571.          }
  572.       } else if (this.gostatus) {
  573.          try {
  574.             Image picgameover = Image.createImage("/tetris_std/goscreen.png");
  575.             this.myg.drawImage(picgameover, (this.width - picgameover.getWidth()) / 2, (this.height - picgameover.getHeight()) / 2, 20);
  576.          } catch (Exception var3) {
  577.             this.myg.drawString("- Game over -", this.width / 2, this.height / 2, 20);
  578.          }
  579.       } else {
  580.          this.myg.setColor(14869218);
  581.          this.myg.fillRect(this.xoffset + this.scaler + 1, this.yoffset + this.scaler + 1, 11 * this.scaler - this.scaler - 1, 21 * this.scaler - this.scaler - 1);
  582.          this.myg.setColor(0);
  583.          this.myg.drawRect(this.xoffset + this.scaler, this.yoffset + this.scaler, 11 * this.scaler - this.scaler, 21 * this.scaler - this.scaler);
  584.          this.myg.setFont(font);
  585.          this.myg.drawString("  Rows", this.fontxoffset, this.yoffset + this.scaler, 20);
  586.          this.myg.drawString("    " + this.allreihen, this.fontxoffset, this.yoffset + this.scaler + font.getHeight(), 20);
  587.          this.myg.drawString("  Level", this.fontxoffset, this.yoffset + this.scaler + font.getHeight() * 2, 20);
  588.          this.myg.drawString("    " + this.level, this.fontxoffset, this.yoffset + this.scaler + font.getHeight() * 3, 20);
  589.          this.myg.drawString("  Points", this.fontxoffset, this.yoffset + this.scaler + font.getHeight() * 4, 20);
  590.          this.myg.drawString("    " + this.points, this.fontxoffset, this.yoffset + this.scaler + font.getHeight() * 5, 20);
  591.          if (!this.paintall && !this.steindown && !this.firstpaint) {
  592.             this.ystart = this.stein.gety() - 3;
  593.             this.xstart = this.stein.getx() - 3;
  594.             this.yende = this.stein.gety() + 3;
  595.             this.xende = this.stein.getx() + 3;
  596.             if (this.ystart < 0) {
  597.                this.ystart = 0;
  598.             }
  599.  
  600.             if (this.xstart < 0) {
  601.                this.xstart = 0;
  602.             }
  603.  
  604.             if (this.yende > 21) {
  605.                this.yende = 21;
  606.             }
  607.  
  608.             if (this.xende > 11) {
  609.                this.xende = 11;
  610.             }
  611.          } else {
  612.             this.ystart = 0;
  613.             this.xstart = 0;
  614.             this.yende = 21;
  615.             this.xende = 11;
  616.          }
  617.  
  618.          for(this.field_1 = this.ystart; this.field_1 <= this.yende; ++this.field_1) {
  619.             for(this.field_0 = this.xstart; this.field_0 <= this.xende; ++this.field_0) {
  620.                if (this.tetrismat[this.field_1][this.field_0] > 10 && this.tetrismat[this.field_1][this.field_0] < 30) {
  621.                   this.myg.drawImage(this.stein.getImage(this.tetrismat[this.field_1][this.field_0]), this.xoffset + this.field_0 * this.scaler, this.yoffset + this.field_1 * this.scaler, 20);
  622.                }
  623.             }
  624.          }
  625.       }
  626.  
  627.       this.repaint();
  628.    }
  629.  
  630.    public void wakemeup() {
  631.       this.gostatus = false;
  632.       this.asleep = false;
  633.       this.firstpaint = true;
  634.       this.zeichnen();
  635.       this.timertask.cancel();
  636.       this.timertask = new timertask(this);
  637.       switch (this.level) {
  638.          case 1:
  639.             this.timer.schedule(this.timertask, 0L, 450L);
  640.             break;
  641.          case 2:
  642.             this.timer.schedule(this.timertask, 0L, 350L);
  643.             break;
  644.          case 3:
  645.             this.timer.schedule(this.timertask, 0L, 300L);
  646.             break;
  647.          case 4:
  648.             this.timer.schedule(this.timertask, 0L, 270L);
  649.             break;
  650.          case 5:
  651.             this.timer.schedule(this.timertask, 0L, 250L);
  652.             break;
  653.          case 6:
  654.             this.timer.schedule(this.timertask, 0L, 230L);
  655.             break;
  656.          case 7:
  657.             this.timer.schedule(this.timertask, 0L, 220L);
  658.             break;
  659.          case 8:
  660.             this.timer.schedule(this.timertask, 0L, 210L);
  661.             break;
  662.          case 9:
  663.             this.timer.schedule(this.timertask, 0L, 200L);
  664.       }
  665.  
  666.    }
  667.  
  668.    public void gosleep() {
  669.       this.timertask.cancel();
  670.       this.asleep = true;
  671.       this.firstpaint = true;
  672.       this.zeichnen();
  673.    }
  674.  
  675.    // $FF: synthetic method
  676.    static stein access$000(maingame x0) {
  677.       return x0.stein;
  678.    }
  679.  
  680.    // $FF: synthetic method
  681.    static boolean access$100(maingame x0, stein x1) {
  682.       return x0.changematrix(x1);
  683.    }
  684.  
  685.    // $FF: synthetic method
  686.    static void access$200(maingame x0) {
  687.       x0.zeichnen();
  688.    }
  689. }
  690.