1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Control C++ problem

Discussion in 'C#' started by creative300, Jun 22, 2014.

  1. #1
    Hello guys! I have a question for you and I'm sorry if I'm wasting your time.
    I made a game in C++(I'm in high school so I don't know a lot of things).
    My problem is that when I try to move my character in right it works if I press the key one time , but if I hold it , the character have a little bit of delay.
    How can I remove that delay?

    if(kbhit()){
      a=getch();
    if((a=='A' && joc[hM-1][lM]!='*' && joc[hM-1][lM]!='#') || (a=='a' && joc[hM-1][lM]!='*' && joc[hM-1][lM]!='#')){
       joc[hM][lM]=' ';
       hM--;
       joc[hM][lM]=minge;}
    else
      if((a=='D'  && joc[hM+1][lM]!='*' && joc[hM+1][lM]!='#') || (a=='d' && joc[hM+1][lM]!='*' && joc[hM+1][lM]!='#')){
        joc[hM][lM]=' ';
        hM++;
        joc[hM][lM]=minge;}
    Code (markup):

    SEMrush
     
    creative300, Jun 22, 2014 IP
    SEMrush