RichLÖVE Mobile 0.10.2 - AdMob+UnityAds

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
modiX
Citizen
Posts: 81
Joined: Mon Dec 04, 2017 1:47 am

RichLÖVE Mobile 0.10.2 - AdMob+UnityAds

Post by modiX » Tue Jul 03, 2018 2:22 pm

Hi,

I decided to create forks of bio1712's AdMob supported forks of LÖVE and started adding more native functionality that is useful for mobile platforms. I'd like to share it with you and I'm welcoming anybody who wants to test all out of it.

The reason why I started this project is I wanted to add UnityAds support to the AdMob fork, because UnityAds is more efficient for game developers than AdMob when it comes to video ads and AdMob reward videos were not working on Android for me. I'm looking forward to add more modules with other native libraries such as In-App-Billing/-Purchases and GameServices/Center (for ranking etc.).

Feel free to use this to enhance and monetise your game in a reasonable matter. Do not start excessive ad bombing! This exists to give indies a way to earn a little with free games, not to destroy the positive vibe of LÖVE. Thank you!

Repositories: Android | iOS

Modules:
  • [love.ads] AdMob (created by bio1712) - Displays banner, interstitial and reward video ads using the native Ad-API of Google, apps.admob.com)
  • [love.uads] UnityAds - Displays video and reward video ads using the native Ad-API of Unity3D, operate.dashboard.unity3d.com)

API:

AdMob

______Please visit the forum thread of bio1712 for an API reference of the love.ads module: Android iOS

UnityAds

______Functions
  • love.uads.isReady(string placementId)
    string placementId : The placement ID of your ad.
    Checks if the video ad with the given placement ID is loaded. The loading of all video ads is triggered by the start of your game, automatically.
    Returns:
    bool isReady: true if the video ad is ready to be shown.
  • love.uads.show(string placementId)
    string placementId : The placement ID of the video ad.
    Plays the video ad with the given placement ID.
______Callbacks
  • love.unityAdsReady(string placementId)
    string placementId : The placement ID of the video ad.
    Fired when a video ad is loaded, successfully.
  • love.unityAdsDidStart(string placementId)
    string placementId : The placement ID of the video ad.
    Fired when a video ad has been started.
  • love.unityAdsDidFinish(string placementId, string finishState)
    string placementId : The placement ID of the video ad.
    string finishState : The finish state when the video ad has been closed by the user. Possible values: Error, Skipped, Completed
    Fired when a video ad has been stopped.
  • love.unityAdsDidError(string error, string message)
    string error : The type of the error. Possible values: NotInitialized, InitializedFailed, InvalidArgument, VideoPlayerError, InitSanityCheckFail, AdBlockerDetected, FileIoError, DeviceIdError, ShowError, InternalError
    string message : The message of the error.
    Fired when a video ad cannot be load.
The repositories contain a sample game.love that allow you to test the modules and learn how to use the functions above.

More:

Override love.run

If you override love.run in your game for any reason (like getting a fixed tick rate), you have to make sure to do some additional things that are part of the modified boot.lua in the ports, because these would not be used, anymore.

Simply require this Lua file and use it like so:

Code: Select all

richbootcp = require "richbootcp"

function love.load()
  richbootcp.boot()
end

function love.update(dt)
  richbootcp.update(dt)
end
After this all RichLÖVE modules work again, even with a custom love.run implementation.

Additional wrapper for one-liner

I also made a wrapper for AdMob and UnityAds that allows to trigger ads with less code. As callback for rewards it uses the beholder lib. This is purely optional.

Since 11.1 seems to have some performance drops in rendering, I decided to stay at LÖVE 0.10.2 for now. In future I will pull the upstream of my forks to the newest LÖVE version, however depending on the performance issue status, I will preserve a branch of 0.10.2 or not.
Visual Studio Code TemplateRichLÖVE Mobile (AdMob+UnityAds)

───▄▀▀▀▄▄▄▄▄▄▄▀▀▀▄───
───█▒▒░░░░░░░░░▒▒█───
────█░░░░░░░░░█────
▄▄──█░░░▀█▀░░░█──▄▄
█░░█▀▄░░░░░░░▄▀█░░█

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 8 guests