title: java game programing enemy explosion
body: <p>hi i am creating a small game as a project.
  the game resembles chicken invader.</p>
  
  <p>the game is run by a gameLoop which constantly calls the render(Graphics g) method to paint changes and the tick() method that changes the x,y coordinates of all moving objects.</p>
  
  <p>i have attempted to make my chickens expload on impact (change their picture to an exploasion)..
  my problem is the change happens so fast the user cannot see it.</p>
  
  <p>i have attempted to use the following:</p>
  
  <pre><code>timer.schedule(new TimerTask() {
                @Override
                public void run() {
                  int temp = deleteExploasion;
                  exploasions.get(temp).setExplosion(false);
                  deleteExploasion++;
                }
              }, /*2*60*1000*/ 1500);
  </code></pre>
  
  <p>it sets a boolean on the chicken and in 1.5 seconds the chicken should in the next render method be painted back.
  but i keep getting</p>
  
  <pre><code>Timer already cancelled.
  at java.util.Timer.sched(Unknown Source)
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Exception in thread "Timer-0" java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
  at java.util.LinkedList.checkElementIndex(Unknown Source)
  </code></pre>
  
  <p>would appreciate help or advice on how to implement such a thing. </p>