Im trying to display my score in a 2d sidescrolling videogame im making in processing. The problem is that my Score is dependent on the Framecount and after the character dies I want to display the score enlarged across the screen. The way my program works is that after the collision occurs a counter is set to a specific Number (100), each loop that counter will decrease and once it hits a certain number the program will restart. My Idea was to display the score in the time between collision and the program restarting. My Problem is that the Score will keep increasing, since the program is still running. Any Ideas on how I could solve this? I tried pausing the draw loop but that doesn't work since the game wont resume again. Thanks a lot for your help.

Here is my Score class:

```
public class Score {
 private PFont font;
 private int x, y; 
 private PImage img;

  //constructor
  public Score ( int x, int y, PFont font) {
    this.x = x;
    this.y = y;
    this.font = font;       
  }

  public void draw () {

    Scorevar = frameCount/20;
    textFont(font);
    fill (0);
    //textAlign(CENTER);
    textMode(MODEL);
    text("Score = "+ Scorevar, x, y);

  }
}

```

Here is the part of my main loop which involves the score 

```
void draw() {
  background (255);

  chari.draw();
 //collision and collison image
  if ( collide_count == 0 ) {
  chari.draw();
  }
   else {

 image( collide, chari.x+130, chari.y+100 );
 collide_count--;

 }
 if ( collide_count > 5 && collide_count < 80) {

   score2.draw();

 }

 if ( collide_count == 5) {

 frameCount = 0;
   setup();
 }

  blockfield.draw();

  score1.draw();

}

```

Code for collision :

```
public void update(float cY, float cW) {
      for ( int i =frameCount/200; i >0; i--) {
     //for (int i =frameCount/400; i >0; i--) {
     //moves blocks right to left
      block[i].x -=(frameCount/200);
      //spawns block when they leave the screen
      if (block[i].x < -Blockpic.width) {
       block[i].setX( random(width, width*2));
       block[i].setY( random (height));
       //println(block[i].x + " " + block[i].y);
      }

      if (block[i].x < 130) {
         if(block[i].y > cY && block[i].y < (cY+cW)){
            //println(collide_count + " with");
            collide_count = 100;

          }
      }
     }
   }

```