Updating My First Game
I have updated all of my first games graphics (using an artist this time - not my two left hands) and would like to add bonus payouts for reaching predetermined $$$ amounts.
Each player starts with $1000 and each time they win an extra $1000 I want to give them a bonus, of say $100.
Players can bet either $5, 10, 25, 50 or 100.
I first set up that when the bankroll was greater than $1000 add $100 - this works fine - except if kept adding the $100 each bet between $1000 and $1999.
How can I set it up so that a player will get a one time bonus for reaching a level greater than $1000 and then again at $2000 etc?
Each player starts with $1000 and each time they win an extra $1000 I want to give them a bonus, of say $100.
Players can bet either $5, 10, 25, 50 or 100.
I first set up that when the bankroll was greater than $1000 add $100 - this works fine - except if kept adding the $100 each bet between $1000 and $1999.
How can I set it up so that a player will get a one time bonus for reaching a level greater than $1000 and then again at $2000 etc?
Comments
somewhere in your betting rules add this:
change self.bonus to (self.bonus+game.bet)%1001
Then have this rule - when self.bonus=1000
change score to score+100
the "%" is called modulus and it takes the remainder of a division problem. This allows you to loop. So if you had a timer that change self.Blah to (self.blah+1)%10 it would count 0,1,2,3,4,5,6,7,8,9,0,1,2,3,4,5...
so your system will get to 1000 and then instead of going to 1001 it will go back to 0 which means it will automatically be ready to start counting towards the next bonus as the player wins bets.