How to make intro game credits

edited July 2015 in How To...

I am trying to make the intro game company game credits with millls but processing counts the time that the app uses the start up so some times the don't show is their a way to get the time of when the app is fully loaded or is their another way to show game credit before the menu?

void setup(){
size(500,500);
}
void draw(){
intro();
}


void intro(){
if ((millis()<3000 & millis()>0)) {
    background(0);
    textSize(22);
    text("Project Developed With", width/2-120, 60);
  }
 if ((millis()>3000 & millis()<5000)) {
    fill(#482E67);
    background(0);
    textSize(22);
    text("Project Designed by", width/2, 60);
    textSize(38);
    textAlign(CENTER);
    text("\n\n\n\n Evil Hatter\n\n\b Project Version .1", width/2, 60);
  }

}

Answers

  • you can store the millis in setup() at the end and compare to this value

    setupEnded = millis();

    make setupEnded a global var (before setup)

    int setupEnded;

  • Here's an example that may help you.

    boolean show_instructions = true;
    int time_to_end_instructions;
    
    void setup(){
      size(200,200);
      time_to_end_instructions = millis() + 3000;
    }
    
    void draw(){
     if( show_instructions ){
       background(0);
       fill(255);
       text("INSTRUCTIONS: Wait three seconds for instructions to end.", 20, 20, 180, 180);
       if(millis() > time_to_end_instructions){
         show_instructions = false;
       }
       return;
     }
     // Put your normal draw code here...
     background(0,128,0); // GREEN IS A GOOD THING TO DRAW!
    }
    
    void mousePressed(){
      show_instructions = true;
      time_to_end_instructions = millis() + 3000;
    }
    
  • would this work with animation or video clip like the game makers logo?

  • Answer ✓

    Yes - Just draw your animation like you normally would. You can also base them on the time remaining until the instructions vanish. try adding this line between lines 13 and 14:

    ellipse(map(time_to_end_instructions-millis(),0,3000,-100,width+100),100,20,20);
    
Sign In or Register to comment.