Free games generally come with ads. The way to end it is to pay for the app. 😉
Seriously, they're not going to give us ways to avoid the ads and still use the games for free, whether they include links to the App Store, or not. I do play free games, and the cost of free play is to deal with closing out of the ads as soon as I can. Sometimes a bit of care with the user interface for the ad may help you avoid the link to the App Store - tap in the right place and you may be able to close the ad without opening App Store. It varies from ad to ad, it's not a setting you can permanently change.