Datasheet
56 SYMBIANOSGAMEBASICS
void CInactivityTimer::StartInactivityMonitor(TTimeIntervalSeconds
aSeconds)
{
if (!IsActive())
{
iTimeout = aSeconds;
Inactivity(iTimeout);
}
}
void CInactivityTimer::RunL()
{// Game has been inactive - no user input for iTimeout seconds
iAppView.SetPausedDisplay(ETrue); // Displays the pause screen
iAppView.StopHeartbeat(); // Stop the game loop
}
The CInactivityTimer::StartInactivityMonitor() meth-
od must be called each time the game loop starts, to monitor for user
inactivity while it is running.
Following any kind of pause, when the user returns to the game and it
regains focus, the game should remain in the paused state until the user
makes an explicit choice to proceed, quit, or perform another action,
depending on what the pause menu offers.
The usability of the pause menu is a hot topic – it’s been said that you
can tell the quality of a mobile game from how easy it is to resume from
the pause menu. This aspect of game design is outside the scope of this
book, but you can find an interesting paper called
At The Core Of Mobile
Game Usability: The Pause Menu
in the Usability section of the Forum
Nokia website (
www.forum.nokia.com/main/resources/documentation/
usability
).
3
This section has a number of other useful documents for
mobile game developers and designers, and I recommend that you
browse them regularly, even if you are developing a mobile game for the
other Symbian OS UI platforms.
2.6.3 Simulating User Activity
There are occasions when the game may want to simulate activity.
For example, while attract mode is playing, it is desirable to prevent
the system from dimming the backlight, the screensaver taking over,
and eventually the backlight turning off completely. This may seem
contradictory, but often games will detect user inactivity, move to attract
mode, and then actually simulate user activity while attract mode is
running, so the graphics can be seen. User activity is simulated by calling
3
The exact location of the paper has a URL which is far too long to type in from a book,
and is subject to change anyway, if the content is updated in future. We will keep a set of
links to papers and resources that are useful to game developers on the Symbian Developer
Network Wiki (
developer.symbian.com/wiki/display/academy/Games+on+Symbian+OS
).