How to call a function properly

Hi,

I have made a simple game (flappy birds copy) to try and teach myself the basics of processing. I am currently trying to make a start screen, so that when I click start the game starts. I tried using different function names and calling theta different times to make this possible. However, it isn't working. Is this the way it should be done or is there a better way?

every time i press start on the game start screen it goes to the main game section BUT it cuts off once I release the button. Ill copy and paste my code here and you can try play it, you'll see what I mean `int xPos=650; int xDir=3; int yPos=150; int yDir=3; int Score = 0; boolean gameover = false;

void setup() { size(667,375); background(150,170,255);

fill(0); textSize(30); } void draw(){

//Start Screen

background(45);

fill(255,10,10); text("Glen's Game",250,150); fill(235); rect(240,165,200,50); fill(150); text("Start",305,200);

if(mousePressed && (240<mouseX && mouseX<440) && (165<mouseY && mouseY<215) ){ GameStart(); }

}

void GameStart(){

background(150,170,255); fill(255); text("Score = "+Score, 500,50);
fill(112,233,165); ellipse(150,yPos,25,25); yPos+=4; fill(255); rect(xPos,0,50,100); fill(100); rect(xPos,275,50,100); xPos-=3; }

void GameOver(){ if(((0375)) {
background(45); fill(255,10,10); text("GAME OVER",250,150); fill(200); text("Try Again",267,200); } }

void Scoring(){ if(xPos==152){ Score++ ; } } void MousePressed(){ if(mousePressed){ yPos= yPos - 12; } if(xPos<1){ xPos=650; } }`

Help much appreciated :)

Tagged:

Answers

  • edited June 2015

    you need a var boolean startScreen = true; (bit like gameover) so that you know when to display your start screen

    • when the mouse is Pressed set startScreen to false and in draw() when it's true show start scren otherwise normal play

    • and in normal play distinguish between gameover and not gameover....

    ;-)

  • edited June 2015

    Hi Chrisir,

    so do you mean have void draw calling the different functions like:

    void draw(){
       StartScreen();
    }
    
    //later on in the code
    void StartScreen(){
         //start screen code
    }
    
  • Also does the code feature ever work on this forum? it never works for me.

  • Answer ✓

    Re-read the instructions. You must not click on C then paste, but you must paste the code, select it, then click on C.

  • Here is the code I have changed, I got the start screen to work but it keeps crashing when I die or going straight back to start screen rather than the game over screen. Can anyone assist? por favor

    int xPos=650;
    int xDir=3;
    int yPos=150;
    int yDir=3;
    int Score = 0;
    boolean gameover = false;
    boolean startscreen = false;
    boolean dead = false;
    
    void setup()
    {
     size(667,375);
      background(150,170,255);
    
      fill(0);
      textSize(30);
    }
    
    void draw(){
      if(startscreen==false){
      StartScreen();
      }
      if(startscreen==true){
      GamePlay();
      MousePressed();
       }
    }
    
    
    void StartScreen(){
    
      //Start Screen
    
        background(45);
       fill(255,10,10);
       text("Glen's Game",250,150);
       fill(235);
       rect(240,165,200,50);
       fill(150);
       text("Start",305,200);
    
       if(mousePressed && (240<mouseX && mouseX<440) && (165<mouseY && mouseY<215) ){
         startscreen=true;
         GamePlay();
       }
    
    
    
    
    
    }
    
    
    
    void GamePlay(){
    
    
      background(150,170,255);
      fill(255);
      text("Score = "+Score, 500,50);  
      fill(112,233,165);
      ellipse(150,yPos,25,25);
      yPos+=4;
      fill(255); 
      rect(xPos,0,50,100);
      fill(100);
      rect(xPos,275,50,100);
      xPos-=3;
    
    
    
     if(((0<yPos && yPos<100) || (275<yPos && yPos<375)) && (100<xPos && xPos<150) || (yPos <0 || yPos >375))
     {  
       GameOver();
     }
    
    
    
      if(xPos==152){
       Score++ ;
      } 
    
    
    
    
    }
    void GameOver(){
    background(45);
      fill(255,10,10);
      text("GAME OVER",250,150);
      fill(200);
      text("Try Again",267,200); 
      dead=true;
      startscreen=false;
      if(mousePressed && (240<mouseX && mouseX<440) && (165<mouseY && mouseY<215) ){
    
         StartScreen();
       }
    }
    
     void MousePressed(){
      if(mousePressed){
        yPos= yPos - 12;
      }
      if(xPos<1){
       xPos=650; 
      }
     }
    
  • "time out occurred while waiting on packet"

    keeps appearing...

  • Answer ✓

    Ha! That's a good one! Great bug! Very awesome!

    Your code is getting stuck in an endless loop.

    See, draw() calls StartScreen() which calls GamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which callsGamePlay() which calls GameOver() which calls StartScreen() which calls....

    Instead of having conditionals call other functions, you need to have the game go into a different mode, or state, when certain conditions are met. You were almost there with the boolean variables...

    Also you're all over the place with MousePressed and mousePressed when really you only need mousePressed().

    int xPos=650;
    int xDir=3;
    int yPos=150;
    int yDir=3;
    int Score = 0;
    boolean gameover = false;
    boolean startscreen = false;
    boolean playing = false;
    
    void setup() {
      size(667, 375);
      background(150, 170, 255);
      fill(0);
      textSize(30);
      startscreen = true;
    }
    
    void draw() {
      if (startscreen) {
        StartScreen();
      }
      if (playing) {
        GamePlay();
      }
      if (gameover) {
        GameOver();
      }
    }
    
    void StartScreen() {
      background(45);
      fill(255, 10, 10);
      text("Glen's Game", 250, 150);
      fill(235);
      rect(240, 165, 200, 50);
      fill(150);
      text("Start", 305, 200);
    }
    
    void GamePlay() {
      background(150, 170, 255);
      fill(255);
      text("Score = "+Score, 500, 50);  
      fill(112, 233, 165);
      ellipse(150, yPos, 25, 25);
      yPos+=4;
      fill(255); 
      rect(xPos, 0, 50, 100);
      fill(100);
      rect(xPos, 275, 50, 100);
      xPos-=3;
      if (((0<yPos && yPos<100) || (275<yPos && yPos<375)) && (100<xPos && xPos<150) || (yPos <0 || yPos >375)) {  
        gameover = true;
        playing = false;
        xPos = 650;
        yPos = height/2;
      }
      if (xPos==152) {
        Score++ ;
      }
      if (xPos<1) {
        xPos=650;
      }
      if(mousePressed){
        yPos= yPos - 12;
      }
    }
    
    void GameOver() {
      background(45);
      fill(255, 10, 10);
      text("GAME OVER", 250, 150);
      fill(200);
      text("Try Again", 267, 200); 
    }
    
    void mousePressed(){
      if ((240<mouseX && mouseX<440) && (165<mouseY && mouseY<215) ) {
        if(gameover){
          startscreen = true;
          gameover = false;
          return;
        } else if(startscreen){
          playing = true;
          startscreen = false;
        }
      }
    }
    
  • yes---

    btw

    since only one of then can be true at a time:

        boolean gameover = false;
        boolean startscreen = false;
        boolean playing = false;
    

    you might as well have one int "state of the program" that can be 0, 1 or 2.

    Thus it is clear, that only one state can be active at the time.

    You can also give 0, 1 or 2 names and use them.

    final int gameover = 0;
    final int startscreen = 1;
    final int playing = 2;
    
    int stateOfTheProgram = startscreen ;
    

    then you can use switch(stateOfTheProgram) in draw()

  • Hey I'm not really sure what you mean by using the 0,1 and 2's to vary the states of the program. I have made a proper game now and I am having this problem again. I can get the game to play and go to the game over screen but when I press try again it goes back to the main menu.

    The problem is when i go to play the game again it just goes starlight to the game over screen and I dunno why :/

    any ideas?

    int xDir = 3;
    int BG1xPos = 0;
    int BG2xPos = 700;
    int SB1xPos = 0;
    int SB2xPos = 700;
    int DyPos = 190;
    int LargeX = int(random(700,900));
    int LargeY = int(random(60,330));
    int MedX = int(random(700,900));
    int MedY = int(random(60,330));
    int SmallX = int(random(700,900));
    int SmallY = int(random(60,330));
    int mineX = int(random(700,900));
    int mineY = int(random(80,320));
    int mine2X = int(random(700,900));
    int mine2Y = int(random(80,320));
    int Score = 0;
    int Quota = 100;
    int deadY = 500;
    PImage BG1; //Background Image(s)
    PImage BG2;
    PImage SB1; //Seabed Image(s)
    PImage SB2;
    PImage DiverUP; //Diver Image(s)
    PImage DiverDOWN;
    PImage DiverNORMAL;
    PImage LClam; //Razor Clam Image(s)
    PImage MClam;
    PImage SClam;
    PImage mine;
    PImage mine2;
    PImage explode;
    PImage GOscreen;
    PImage deadDiver;
    PImage strtScreen;
    Boolean UpPressed = false;
    Boolean DownPressed = false;
    boolean gameover = false;
    boolean playing = false;
    boolean startscreen = true;
    
    
    
    void setup(){
    
     size(700,400); //size of the screen
     textSize(25);  //text size set for all text
     BG1 = loadImage("mainBG1.png");
     BG2 = loadImage("mainBG1.png");
     SB1 = loadImage("seabed.png");
     SB2 = loadImage("seabed.png");
     DiverUP = loadImage("DiverUP.png");
     DiverDOWN = loadImage("Descending.png");
     DiverNORMAL = loadImage("Neutral.png");
     LClam = loadImage("LargeClam.png");
     MClam = loadImage("MediumClam.png");
     SClam = loadImage("SmallClam.png"); 
     mine = loadImage("SeaBomb.png");
     mine2 = loadImage("SeaBomb.png");
     explode = loadImage("Explosion.png");
     GOscreen = loadImage("GameOver.png");
     deadDiver = loadImage("deadDiver.png");
     strtScreen = loadImage("StartScreen.png");
    }
    
    void draw(){
      if(startscreen==true){
      startScreen();
      }
      if(playing==true){
      Playing();
    }
    if(gameover==true){
      gameOver();
    }
    }
    
    void mouseClicked(){
    if(startscreen==true){
    if((40<mouseX && mouseX<215) && (196<mouseY && mouseY<226)){
    startscreen=false;
    gameover=false;
    playing=true;
    }
    }
    if(gameover==true){
    if((40<mouseX && mouseX<215) && (216<mouseY && mouseY<246)){
    
      startscreen=true;
      gameover=false;
      playing=false;
    
    }
    }
    }
    
    
    
    void keyReleased(){
        UpPressed = false;
        DownPressed = false;
    }
    
    void keyPressed(){
      if(key == CODED){
      if(keyCode ==UP){
        UpPressed = true;
        DownPressed = false;
      DyPos-=12;
      DiverU();
      }
      if(keyCode ==DOWN){
        UpPressed = false;
        DownPressed = true;
      DyPos+=12;
      DiverD();
      }
      if(DyPos<60){
      DyPos=60;
      }
      if(DyPos>330){
      DyPos=330;
      }
      }
    }
    
    void startScreen(){
      image(strtScreen,0,0);
      fill(255);
      rect(40,196,75,30);
      fill(0);
      text("Start",50,220);
    
    }
    
    
    void Playing(){
    BackgroundScreen();
      score();
      clamsL();
      clamsM();
      clamsS();
      mines();
      collisions();
      if(UpPressed == false && DownPressed == false){
      DiverN();
      }
      if(UpPressed == true && DownPressed == false){
      DiverU();
      }
      if(UpPressed == false && DownPressed == true){
      DiverD();
      }
    
    }
    
    void gameOver(){
      image(GOscreen,0,0);
      image(deadDiver,440,deadY);
      fill(255);
      rect(40,216,150,30);
      fill(0);
      text("Try Again",50,240);
      if(deadY>100){
        deadY-=3;
    }
    }
    
    void collisions(){
    //Clam collisons
      if((23<LargeX && LargeX<122) && (DyPos<LargeY && LargeY<(DyPos+43))){
        LargeY=int(random(60,330));
        LargeX=int(random(725,1100));
      Score+=15;
    }
    if((23<MedX && MedX<120) && (DyPos<MedY && MedY<(DyPos+43))){
        MedY=int(random(60,330));
        MedX=int(random(725,1100));
      Score+=5;
    }
    if((23<SmallX && SmallX<116) && (DyPos<SmallY && SmallY<(DyPos+43))){
        SmallY=int(random(60,330));
        SmallX=int(random(725,1100));
      Score+=2;
    }
    //Mine Collisions
    if(((23<mineX && mineX<122) && (DyPos<mineY && mineY<(DyPos+43))) || ((23<mine2X && mine2X<122) && (DyPos<mine2Y && mine2Y<(DyPos+43)))){
        image(explode,20,(DyPos-30));
        playing=false;
        gameover=true;
    }
    
    
    }
    //Score
    void score(){
      fill(209,52,52);
      text("Score = £"+Score, 520,40);
      fill(205,186,23);
      text("Quota = £"+Quota, 25,40);
    }
    
    //All mine images
    void mines(){
       image(mine,mineX,mineY);
      mineX-=1;    
      if(mineX<1){
        mineY=int(random(60,330));
        mineX=int(random(725,1100)); //resets clam
      }
         image(mine2,mine2X,mine2Y);
      mine2X-=1;    
      if(mine2X<1){
        mine2Y=int(random(60,330));
        mine2X=int(random(725,1100)); //resets clam
      }
    
    }
    
    
    //All Clam images
    void clamsL(){  
      image(LClam,LargeX,LargeY);
      LargeX-=1;    
      if(LargeX<1){
        LargeY=int(random(60,330));
        LargeX=int(random(725,1100)); //resets clam
      }
    }
    void clamsM(){
      image(MClam,MedX,MedY);
      MedX-=2;
      if (MedX<1){
        MedY=int(random(60,330));
        MedX=int(random(725,1100));  //resets clam
      }
    }
    void clamsS(){
      image(SClam,SmallX,SmallY);
      SmallX-=2; 
       if(SmallX<1){
        SmallY=int(random(60,330));
        SmallX=int(random(725,1100)); //resets clam
      }
    }
    
    
    
    //All Diver Images
    void DiverN(){
      image(DiverNORMAL,23,DyPos); 
    }
    void DiverU(){
      image(DiverUP,23,DyPos); 
    }
    void DiverD(){
      image(DiverDOWN,23,DyPos); 
    }
    
    //All Background Images
    void BackgroundScreen(){
    
        image(BG1,BG1xPos,0); //Background Images called
        image(BG2,BG2xPos,0);
        image(SB1,SB1xPos,357);
        image(SB2,SB2xPos,357);
    
        BG1xPos-=2;  //Background Images move to the left (animation)
        BG2xPos-=2;
        SB1xPos-=1; //Seabed animation to the left (slower speed)
        SB2xPos-=1;
    
      if(BG2xPos<1){
        BG1xPos=0; //resets background images
      }
      if (BG2xPos<1){
        BG2xPos=700;  //resets background images
      }
        if(SB2xPos<1){
        SB1xPos=0; //resets background images
      }
      if (SB2xPos<1){
        SB2xPos=700;  //resets background images
      }
    }
    
  • Probably the obvious: you set the default variable values before setup. This only ever gets called once.

    So create a separate function called resetVariables. Set the variable defaults using this, by calling it at setup and on game over. This will then reset all variables - including gameover - to the default starting state...

  • I have tried what you said but it still skips past the playing(); function the second time around and just goes straight to game over :/ I don't understand why it works first time round but not the second??

  • Where's the updated code? Do println(gameover) where appropriate to check it has actually been reset...

  • This is what I done, maybe I haven't followed your instructions correctly but as far as Im aware I have. not sure why it still isn't working. :/

    int xDir = 3;
    int BG1xPos = 0;
    int BG2xPos = 700;
    int SB1xPos = 0;
    int SB2xPos = 700;
    int DyPos = 190;
    int LargeX = int(random(700,900));
    int LargeY = int(random(60,330));
    int MedX = int(random(700,900));
    int MedY = int(random(60,330));
    int SmallX = int(random(700,900));
    int SmallY = int(random(60,330));
    int mineX = int(random(700,900));
    int mineY = int(random(80,320));
    int mine2X = int(random(700,900));
    int mine2Y = int(random(80,320));
    int Score = 0;
    int Quota = 100;
    int deadY = 500;
    PImage BG1; //Background Image(s)
    PImage BG2;
    PImage SB1; //Seabed Image(s)
    PImage SB2;
    PImage DiverUP; //Diver Image(s)
    PImage DiverDOWN;
    PImage DiverNORMAL;
    PImage LClam; //Razor Clam Image(s)
    PImage MClam;
    PImage SClam;
    PImage mine;
    PImage mine2;
    PImage explode;
    PImage GOscreen;
    PImage deadDiver;
    PImage strtScreen;
    Boolean UpPressed = false;
    Boolean DownPressed = false;
    boolean gameover;
    boolean playing;
    boolean startscreen;
    
    
    
    void setup(){
    
     size(700,400); //size of the screen
     textSize(25);  //text size set for all text
     BG1 = loadImage("mainBG1.png");
     BG2 = loadImage("mainBG1.png");
     SB1 = loadImage("seabed.png");
     SB2 = loadImage("seabed.png");
     DiverUP = loadImage("DiverUP.png");
     DiverDOWN = loadImage("Descending.png");
     DiverNORMAL = loadImage("Neutral.png");
     LClam = loadImage("LargeClam.png");
     MClam = loadImage("MediumClam.png");
     SClam = loadImage("SmallClam.png"); 
     mine = loadImage("SeaBomb.png");
     mine2 = loadImage("SeaBomb.png");
     explode = loadImage("Explosion.png");
     GOscreen = loadImage("GameOver.png");
     deadDiver = loadImage("deadDiver.png");
     strtScreen = loadImage("StartScreen.png");
     resetVariables();
    }
    
    void draw(){
      if(startscreen==true){
        startScreen();
      }
      if(playing==true){
      Playing();
    }
    if(gameover==true){
      gameOver();
    }
    }
    
    void mouseClicked(){
    if(startscreen==true && playing == false && gameover==false){
    if((40<mouseX && mouseX<215) && (196<mouseY && mouseY<226)){
    playing=true;
    startscreen=false;
    gameover=false;
    }
    }
    if(gameover==true && playing ==false && startscreen==false){
    if((40<mouseX && mouseX<215) && (216<mouseY && mouseY<246)){
    
      resetVariables();
      Score=0;
      deadY=500;
    
    }
    }
    }
    
    
    
    void keyReleased(){
        UpPressed = false;
        DownPressed = false;
    }
    
    void keyPressed(){
      if(key == CODED){
      if(keyCode ==UP){
        UpPressed = true;
        DownPressed = false;
      DyPos-=12;
      DiverU();
      }
      if(keyCode ==DOWN){
        UpPressed = false;
        DownPressed = true;
      DyPos+=12;
      DiverD();
      }
      if(DyPos<60){
      DyPos=60;
      }
      if(DyPos>330){
      DyPos=330;
      }
      }
    }
    
    void resetVariables(){
     startscreen=true;
    gameover=false;
    playing=false;
    }
    
    
    void startScreen(){
      image(strtScreen,0,0);
      fill(255);
      rect(40,196,75,30);
      fill(0);
      text("Start",50,220);
    
    }
    
    
    void Playing(){
    BackgroundScreen();
      score();
      clamsL();
      clamsM();
      clamsS();
      mines();
      collisions();
      if(UpPressed == false && DownPressed == false){
      DiverN();
      }
      if(UpPressed == true && DownPressed == false){
      DiverU();
      }
      if(UpPressed == false && DownPressed == true){
      DiverD();
      }
    
    }
    
    void gameOver(){
      image(GOscreen,0,0);
      image(deadDiver,440,deadY);
      fill(255);
      rect(40,216,150,30);
      fill(0);
      text("Try Again",50,240);
      if(deadY>100){
        deadY-=3;
    }
    }
    
    void collisions(){
    //Clam collisons
      if((23<LargeX && LargeX<122) && (DyPos<LargeY && LargeY<(DyPos+43))){
        LargeY=int(random(60,330));
        LargeX=int(random(725,1100));
      Score+=15;
    }
    if((23<MedX && MedX<120) && (DyPos<MedY && MedY<(DyPos+43))){
        MedY=int(random(60,330));
        MedX=int(random(725,1100));
      Score+=5;
    }
    if((23<SmallX && SmallX<116) && (DyPos<SmallY && SmallY<(DyPos+43))){
        SmallY=int(random(60,330));
        SmallX=int(random(725,1100));
      Score+=2;
    }
    //Mine Collisions
    if(((23<mineX && mineX<122) && (DyPos<mineY && mineY<(DyPos+43))) || ((23<mine2X && mine2X<122) && (DyPos<mine2Y && mine2Y<(DyPos+43)))){
        image(explode,20,(DyPos-30));
        startscreen=false;
        playing=false;
        gameover=true;
    }
    
    
    }
    //Score
    void score(){
      fill(209,52,52);
      text("Score = £"+Score, 520,40);
      fill(205,186,23);
      text("Quota = £"+Quota, 25,40);
    }
    
    //All mine images
    void mines(){
       image(mine,mineX,mineY);
      mineX-=1;    
      if(mineX<1){
        mineY=int(random(60,330));
        mineX=int(random(725,1100)); //resets clam
      }
         image(mine2,mine2X,mine2Y);
      mine2X-=1;    
      if(mine2X<1){
        mine2Y=int(random(60,330));
        mine2X=int(random(725,1100)); //resets clam
      }
    
    }
    
    
    //All Clam images
    void clamsL(){  
      image(LClam,LargeX,LargeY);
      LargeX-=1;    
      if(LargeX<1){
        LargeY=int(random(60,330));
        LargeX=int(random(725,1100)); //resets clam
      }
    }
    void clamsM(){
      image(MClam,MedX,MedY);
      MedX-=2;
      if (MedX<1){
        MedY=int(random(60,330));
        MedX=int(random(725,1100));  //resets clam
      }
    }
    void clamsS(){
      image(SClam,SmallX,SmallY);
      SmallX-=2; 
       if(SmallX<1){
        SmallY=int(random(60,330));
        SmallX=int(random(725,1100)); //resets clam
      }
    }
    
    
    
    //All Diver Images
    void DiverN(){
      image(DiverNORMAL,23,DyPos); 
    }
    void DiverU(){
      image(DiverUP,23,DyPos); 
    }
    void DiverD(){
      image(DiverDOWN,23,DyPos); 
    }
    
    //All Background Images
    void BackgroundScreen(){
    
        image(BG1,BG1xPos,0); //Background Images called
        image(BG2,BG2xPos,0);
        image(SB1,SB1xPos,357);
        image(SB2,SB2xPos,357);
    
        BG1xPos-=2;  //Background Images move to the left (animation)
        BG2xPos-=2;
        SB1xPos-=1; //Seabed animation to the left (slower speed)
        SB2xPos-=1;
    
      if(BG2xPos<1){
        BG1xPos=0; //resets background images
      }
      if (BG2xPos<1){
        BG2xPos=700;  //resets background images
      }
        if(SB2xPos<1){
        SB1xPos=0; //resets background images
      }
      if (SB2xPos<1){
        SB2xPos=700;  //resets background images
      }
    }Okay i think its something to do with the mouseClicked() function. As when i click the screen not on the button it  takes me to game over or somethi
    
  • edited June 2015

    You haven't done I what suggested. You need to reset every variable that appears before setup that will later be changed, including the position of the player and bad guys. Otherwise at start of next game player is already dead = gameover... To avoid duplication declare variables before setup. Set their values using a function. Call this function at setup and at restart...

  • An online game example which calls createBalloons() in order to restart the game: :D
    http://studio.ProcessingTogether.com/sp/pad/export/ro.9V7R1wu55fOiN/latest

  • Got ya now blindfish! It was because I wasn't resetting the coordinates of the mines meaning when I started again it was detecting a collision straight away taking me to the game over screen! haha

Sign In or Register to comment.