It’s quite normal for devices to heat up under heavy use. However, you don't need to worry as all you have to do is follow a few steps to minimize the effects of what we call “hot device battery drain”. Follow these tips for improved performance as they have been proven to reduce excessive heat build-up, so trying them out is very much worthwhile.
1. Try turning off other apps you have running while playing the game.
2. Turn off Bluetooth connections (unless, of course, they're required for your internet access).
3. Check if your device is fully charged, or, at least, has more than 50% battery life available (of course, you can still play with less, but for optimal performance, more is always better).
4. Check if your device's version of iOS is up to date.
5. Make sure you’ve updated the game as well (this can be done by checking on Nonstop Knight) in the App Store)
6. Please contact Apple directly for further details if the problem persists or even worsens somehow.
If you're playing any game for a prolonged period of time, it automatically will make your device work very hard, making some degree of heating up impossible to avoid completely.