Android Tutorial [B4X] [BitmapCreator] Cross platform Falling Sand game

Roger Taylor

Member
Licensed User
Longtime User
I have another question concerning the main game loop. It calls mGame.Tick(gs) after gs.GameTime is incremented. What does .GameTime actually control? I need another loop that runs as fast as the app will allow with no concerns about the FPS. This is where I need to do my CPU stepping. So far I've only been able to get a 60 Hz CPU rate because the MainLoop seems to be locked to this and that's where I temporarily placed my test CPU stepping call.

Also, does the GameStep class do all of the FPS maintenance? I see it locking to 30, 60, 90, 120 FPS... the nearest it can achieve for the device the app is running on.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
What does .GameTime actually control?
It allows the consumer to have a time measurement that is separate from the actual FPS.
I wouldn't spend too much time with this code as a much more powerful implementation is available in X2 framework.
In X2 it tries to maintain 60 FPS and reduces it to 30 FPS if needed. It tries to avoid fluctuations which are more noticeable than a lower frame rate.
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…