For example If the player dies 7 times,an ad pops up and when you press back,the game continues.Player dies 7 times again,ad shows up and so on.
use a variable
variableDieCount = 0
now each time the player die add 1 to variableDieCount
Player die - - System add 1 to variableDieCount
now the magic
System if variableDieCount = 7 - - Appdeal (your add pluging) show Ads
syetem set variableDieCount to 0
sign up for Appodeal Ads networt Here
http://appodeal.com/+702cce69791d2fb67f4a39d2464ee1a7
and the tutorial here
https://www.scirra.com/tutorials/4979/a ... onstruct-2
hope this help
Develop games in your browser. Powerful, performant & highly capable.
You can also use modulus to test for this, without having to set your deathcount back to 0.
on player death ≫ add 1 to player.deathCount
if player.deathCount % 7 = 0
[show ad]
Edit: Modulus gets the remainder after a division;
5 % 3 = 2
9 % 6 = 3