Some ad providers, for example Supersonic and
AdColony, have interstitial advertisements that can take the
form of an "offer wall" (essentially a page to promote several
different advertising campaigns) or a video where virtual currency
is rewarded to the player, so it's important to know when one of
these adverts is being shown. This function will return
true if such an ad is currently active or false
if it is not.
if ads_engagement_available() && show
show = false;
The above code checks to see if there is currently and interstitial ad active and if not, then it will check to see if one is available and that the variable "show" returns true. If both conditions are met, an interstitial ad will be launched and the variable set to false, so that when the add is finished the check will take the player to the next room.