ads appearing after 3 attempts at main game

johnjanowskibsc

  • *
  • Posts: 37
Hi,

I would love to have the code for this! Currently my ads appear after the 1st play of the game when the main game scene transitions to the game over screen. Then it never appears again!

I would like the ads to appear after 3 attempts of playing the main game. I've tried using an attribute that counts every time "retry" is pressed - I think it should work...but it doesn't!

Any help would be great

John

JeffreyDriver

  • Posts: 1862
Can you post your code?

Just a comment regarding my personal preferences; I prefer if ads are shown after a certain amount of time, not attempts, because if you have several very short games in a row, it feels like you're being bombarded with ads.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

johnjanowskibsc

  • *
  • Posts: 37
here's the code. I thought about having it timed, would you use a boolean to return the ad back to false and then restart the timer for that?

JeffreyDriver

  • Posts: 1862
In your code I see nothing to increment the ad counter.

For a timed counter, I would have it increment every second, then when the game over screen appears, if the timer is over so many numbers, say 300, set the timer back to 0, then show the advert.
Current Projects:
Retro Redux Compilation (NEW).
Retro Redux (untitled) (NEW).
I always appreciate useful feedback. Thank you.
www.jeffreydriver.co.uk

johnjanowskibsc

  • *
  • Posts: 37
Sorry, forgot to include the increment part. Basically every time "retry" was pressed it added 1 onto the "ad" attribute. I will try the timed counter code later on. thanks

colburt187

  • *
  • Posts: 2270
are you sure the code that sets it back to zero is not doing that before the advert gets a chance to show. Have you tried drawing the ads attribute to the screen to make sure its working?

CmdrWhitey13

  • Posts: 488
If you did it timed style, why not the following:

When created (For every (x) seconds, show ad)

May need to hide the ad as well for x ammount of time as well.

Hope it helps.

johnjanowskibsc

  • *
  • Posts: 37
Ok, so I've tried the above suggestions but the ad only loads once and once only.

My main game has its own scene and when it is game over it switches to a Game over scene where it displays the score and this is where I want the ad to load on. Is it because I am switching between 2 scenes, that once a scene is created, it is still live.
For example, when I press the retry button on the score scene, does that kill the scene? The retry button goes back to the main game scene and when 60 seconds is up it then transitions to the game over scene. As the game over scene has already been created does it execute the "when created" block?

johnjanowskibsc

  • *
  • Posts: 37
sorry! solved it. The load ad block was on the start up scene, not within the scene it was loading in. I've now moved it! John