title: Java Applet Game - get gameover of multiple Objects
body: <p>I am creating a game and I got stuck at this level where I want to get the boolean gameover of multiple objects. Please have a look at the code to understand better.</p>
  
  <pre><code>public class Platform {
  
  private int x, y , radius;
  private int dx , dy;
  private boolean game_over = false;                          ///HERE
  
  public Platform(int x, int y) {
      this.x = x;
      this.y = y;
      radius = 5;
      dx = -1;
      dy = 1;
  }
  
  private void checkForCollision(Ball b){
      int ballX = b.getX();
      int ballY = b.getY();
      int ballRadius = b.getRadius();
  
      int a = ballX - x;
      int bb = ballY - y;
      int c = ballRadius + radius;
  
      double collide = Math.sqrt((double) a*a + (double) bb*bb);
      if ( c &gt; collide){
          game_over = true;                               ///HERE
          Random r = new Random();
          y = 0 - 50 - r.nextInt(300);
      }
  }
  
  public boolean getgameOver() {                          ///HERE
      // TODO Auto-generated method stub
      return game_over;
  }
  </code></pre>
  
  <p>That is the platform class, now in the Main Class, i want to get the game over but i don't know how, look:</p>
  
  <pre><code>public class MainClass extends Applet implements Runnable, KeyListener{
  
  URL url;
  Image city, i;
  Graphics doubleG;
  int cityX = 0;
  Ball b;
  Platform p[] = new Platform[20];            ///I DON'T KNOW HOW TO GET                                                
  private int levelcheck = 0;                 ///GAMEOVER FROM AN ARRAY
  private int score;
  boolean GameOver = false;                 ///HERE
  
  @Override
  public void init() {
      setSize(800,400);
      addKeyListener(this);
  }
  
  @Override
  public void start() {
      score = 0;
      b = new Ball();
      for (int i = 0; i&lt; p.length; i++){
          Random r = new Random();
          p[i] = new Platform(this.getWidth() - r.nextInt(800), 0 - 100*i);
      }
      Thread thread = new Thread(this);
      thread.start();
  }
  
  
  @Override
  public void run() {
      while (true){
          GameOver = p[0].getgameOver();      //I CAN GET GAME OVER OF ONLY  
          if (!GameOver){              //THE FIRST BALL BUT NOT THE OTHER 19      
              score++;
          }
  ....
  </code></pre>
  
  <p>thank you guys in advance</p>