Answer to actual question (Does a game loop need to be in a separate thread):
The reason people often recommend using a separate thread is because they don't want heavy processing to interfere with UI interactivity. You are the only one who can tell if a separate thread is needed for your game. It entirely depends on the engine and framework if the main game loop in your present design may interfere with the UI's response time. Thought you generally assume it won't (in small projects) unless you have a reason to think otherwise.
Another reason to keep code in seperate threads is to keep code modular and simple. Having two unrelated pieces of code mixed together can often cause code to become less readable and maintainable in the long run.
Does a game loop need to run on it's own separate thread? Possibly. If there is a problem with response time or code and you need multiple UI items to respond regardless of heavy processing or you simply wish to break the code into specific tasks that occur simultaneously for design reasons then go with it. However, it is considered an advanced programming practice.
A simple but perhaps not a great example to illustrate is a two player game. You may want to run two instances of a class that handles user input and converts to state changes in player character instance.
Some frameworks encourage/require you to utilize and event/interrupt based system like ActionScript3.0 does. In those case the loop code will normally go to the OnEnterFrame
event or something similar that occurs 20 - 60 or 120 times per second.
Answer to original question (Do I need a main loop):
It all boils down to the program counter. If you are making a game that will run more than a predetermined amount of time and will not generate code as it goes then you will need to kindly request your user's pc to repeat some instructions that it has already processed and what will possibly change in the meantime is the state (the values stored in the game's objects and globals).
Since you know you will need to repeat instructions, there are several ways to complete this task and continually process the same instructions. All these methods involve moving the program counter back to the currently relevant instruction. The most common control flow statements that cause code to be repeated are called loops, another is the goto
statement which is rarely used in modern code and has a similar effect in this case (completely not relevant to you).
So to answer your previous question, do you need a loop? Yes, you do.