I'm writing a small ball game. I have a function called `gravity` and I also have a while loop that checks whether the user wants to move the ball using wsad keys.

Do I need to multi thread this or is there another way out? I cut out some of the irrelevant code for setting up the program. Here is just the stuff that matters:

```
while(1) {
enableGravity();
char ch = getch();// i know getch() is not going to cut it
//maybe 2 different f() multi threaded , for gravity and position, 
f(ch == 'w' || ch == 'W')
                updateObjPosition('U');       
          else if(ch == 's' || ch == 'S')
                updateObjPosition('D');
          else if(ch == 'a' || ch == 'A')
                updateObjPosition('L');
          else  if(ch == 'd' || ch == 'D')
                updateObjPosition('R');

          }

```

I have these functions in main. I need the program to enable gravity and also be able to accept input to move the ball through `updateObjPosition()` **simultaneously**.