Auto-detecting Device Orientation Whilst Allowing User to Override

The Problem

When creating games (and other apps), screen orientation is very important. In general, more casual games use portrait, whilst more hardcore / intense games use landscape. However, some games may be inbetween these two categories, or may wish to reach a wider audience by supporting both. Automatically rotating to match device orientation is easy, but allowing the user to “lock” one orientation is a little trickier.
Continue reading “Auto-detecting Device Orientation Whilst Allowing User to Override”

Selectively Playing Tracks Whilst Game Is Active / Open

The Problem

Playing background music on Android is pretty easy: just start a service with a media player. Great, that was easy! However, when the user presses the home button, the music… continues. This is good for music apps, but awful for games. In this example, Blacksmith Slots had one music track for the intro, and one for the main game. Continue reading “Selectively Playing Tracks Whilst Game Is Active / Open”