class PlayMode extends GameMode {

  int millisDrawWasLastCalled;
  GameWorld gameWorld;

  PlayMode() {
    millisDrawWasLastCalled = millis(); 
    gameWorld = new GameWorld();
  }

  void draw() {

    int millisNow = millis();
    float timeElapsed = (millisNow - millisDrawWasLastCalled) / 1000.0; // since the last frame, in seconds.
    //println(timeElapsed);
    gameWorld.draw();
    gameWorld.animate(timeElapsed);

    /*
    if (timeElapsed < 2) {
     gameWorld.animate(0);
     gameWorld.draw();
     }
     if ( timeElapsed > 4) {
     fill(0);
     textSize(80);
     text("3", ScreenWidth/2, ScreenHeight/2);
     }
     
     if ( timeElapsed > 5) {
     fill(0);
     textSize(80);
     text("2", ScreenWidth/2, ScreenHeight/2);
     }
     if ( timeElapsed > 6) {
     
     fill(0);
     textSize(80);
     text("1", ScreenWidth/2, ScreenHeight/2);
     }
     */
  }

  void mouseClicked() {
    redraw();
  }

  void keyPressed() {
    gameWorld.keyPressed();
  }

  void keyReleased() {
    gameWorld.keyReleased();
  }
}
