Example #1
0
 public MyPanel(int x, int y, boolean ai, String difficulty) {
   this.setSize(x, y);
   map = new Map(0, THA.HEIGHT, 0, THA.WIDTH);
   shapeAI = new AI(ai, difficulty);
   map.randomGenerateMap();
   map.clearLines();
   character = new Character(100, THA.HEIGHT / 2 - 40, 5, 0.1, 10);
   water = new Water(0, THA.WIDTH, 0, THA.HEIGHT, 5);
   addKeyListener(this);
   addMouseListener(this);
   for (int i = 0; i < 6; i++) {
     addShape();
   }
   startWater = System.currentTimeMillis();
   buttonTimer.start();
 }