I use one thread and a synchronized procedure for a simple game loop.
On my computer, Windows 7, it works as a charm but when I run it on my android device and after I click play and the thread starts the screen goes black or sometimes dim, and sometimes it stays normal but all objects visible on screen either stretch or fail to render properly; at this point the thread seems to be frozen (The music from the main form still continue to play).
Here is the thread itself:
while NOT Terminated do
//The Following repeats itself every second:
if TC>(TCTime+10000000) then
TimeT:= TimeT+1; //Time in seconds
//Increasing game playing speed:
Gravity:= Gravity + 0.0075 * DEF;
//…just to have it on screen:
With MainForm do
//This seems to make the loop run smooth and without lagging on my PC:
if TC>(TCLast) then
This is how it starts: