playMaker

Author Topic: Bonus Level  (Read 1340 times)

heavygunner

  • Sr. Member
  • ****
  • Posts: 344
Bonus Level
« on: January 01, 2020, 03:06:15 AM »
Hello !

I made a small casual game with Infinite levels.Levels will be automatically generated in run time. What I want is, i want to display a Bonus Level after every 5 levels completed. Is there any way to achieve this easily ?

Currently, I use Int compare. When level number is 6,11,16,21,26....... . Launch the Bonus level.
Any other easy ways ?


...

  • Beta Group
  • Hero Member
  • *
  • Posts: 1294
Re: Bonus Level
« Reply #1 on: January 01, 2020, 08:15:19 AM »
You can get the number of the level each level, if you can divide it by five, the next level loaded should be the bonus level, if not, then regular level.

If it can be divided you will get 1, 2, 3, 4 and so on. If it can't be divided, you'll get zero. So you only need one int compare (compare with 0, if equal, load regular level, if not equal, load bonus level).