title: Why the objects are not drawing when i check collision?
body: <p>Hi I am trying to create a space invaders game and I have a problem with the collision between a missile and an enemy. I created a function that checks the collision using the intersects method from rectangle but when I call it in the update method of enemy the missiles are not launching from the player correctly and I can't figure out why.</p>
  
  <pre><code>//enemy class
  public void checkCollisions(){
  
     for(int i=0;i&lt;GameFrame.getMissileList().size();i++){
  
         Missile m = GameFrame.getMissileList().get(i);
  
         if(getBounds().intersects(m.getBounds()))
             GameFrame.removeEnemy(this);
             GameFrame.removeMissile(m);
     }
  }
  </code></pre>
  
  <p>//the method getbounds of rectangle</p>
  
  <pre><code>public Rectangle getBounds()
  { return new 
  Rectangle(x,y,getEnemyImg().getWidth(null),getEnemyImg().getHeight(null));
  }
  </code></pre>
  
  <p>//</p>
  
  <pre><code>public void actionPerformed(ActionEvent e)
  {
      player.update();
      repaint();
  
      for(int i=0; i&lt;enemies.size();i++)
      {
          Enemy tempEnemy = enemies.get(i);
          tempEnemy.update();
      }
  
      for(int i=0; i &lt; missiles.size();i++)
      {
          Missile m = missiles.get(i);
          m.update();
  
      }
  
      repaint();
  }
  </code></pre>