For the complete documentation index, see llms.txt. This page is also available as Markdown.

In Game Ads

All Out allows developers to show players advertisements in their game

Rewarded

Rewarded ads are optional ads players can watch to earn something in your game. For example, you could have a Prize Wheel that players spin by watching an ad to have a chance of earning extra coins or items in your game.

API Reference

Ads :: struct {
    prompt_rewarded_ad :: proc(
        player: Player,
        reward_id: string,
        title: string,
        description: string,
        texture: Texture_Asset
    );

    is_ad_showing :: proc() -> bool;
}

Use a stable reward_id for each reward. Grant the reward only from ao_ads_reward_handler, which runs after the platform reports a completed rewarded ad:

show_coin_ad :: proc(player: Player) {
    if Ads.is_ad_showing() return;

    icon := get_asset(Texture_Asset, "ui/coin.png");
    Ads.prompt_rewarded_ad(
        player,
        "coins_100",
        "Earn 100 coins",
        "Watch an ad to receive 100 coins.",
        icon
    );
}

ao_ads_reward_handler :: proc(player: Player, reward_id: string) -> bool {
    if reward_id != "coins_100" return false;

    Economy.deposit_currency(player, "Coins", 100);
    return true;
}

Register the currency before using this example; see Economy. Return true only after the reward was granted. Return false for an unknown ID or when the grant could not be completed.

Interstitial

Interstitial ads are shown between rounds or during periods of low activity in your game to generate revenue, but do not directly reward players.

For example you could show an interstitial after each round of Murder Mystery while players would be waiting for the next round to start anyways.

Last updated