Skip to content

Video ads

Requirements for Advertisements

Please be sure to read our advertisement requirements, since your game will be rejected without any feedback if it doesn't follow them.

Playing an ad break

Ad breaks can be requested using crazy_break(). When this is called, an overlay will be displayed on top of your game, as the ad is being loaded. We support two different types of ad breaks: midgame and rewarded.

Midgame advertisements can happen when a user died, a level has been completed, etc. Rewarded advertisements can be requested by the user in exchange for a reward (An additional life, a retry when the user died, a bonus starting item, extra starting health, etc.). Rewarded ads should be shown only when users explicitly consent to watch an advertisement.

By default crazy_break() shows a midgame advertisement. crazy_break() has an optional argument that indicates the ad type. You can request both types as follows:

crazy_break("midgame");
crazy_break("rewarded");

Info

If it was less than 3 minutes since the last midgame ad, then a midgame ad will not show. This is automatically handled by the SDK and it is not necessary to implement your in-game timer to manage this.

Pausing audio during ads

Ad breaks are displayed as an overlay on top of your game. Your game continues running in the background. To ensure that the game does not interfere with the advertisement, your sound must be muted when the ad starts and turned back on when it has stopped. You can do this by customizing the gmcallback_crazy_callback() function.

The three kinds of events are:

  • "crazy.break.started" is emitted when an advertisement starts playing.
  • "crazy.break.finished" is emitted when an advertisement stops playing.
  • "crazy.break.error" is emitted when an error has occurred, or the ad wasn't filled. This event is also emitted when no advertisement is available.

Adblock detection

We detect whether the user has installed an adblock tool. We pass this information to the developer through the SDK. The adblock detection is executed when crazy_init() is called. You will have to implement an event listener on "crazy.adblock.detected" which is fired when the adblock detection finished running. See the example at the end of this guide.