00:00
00:00
Newgrounds Background Image Theme

Avrram just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

Resetting coin count to 0 and add

816 Views | 1 Reply

Resetting coin count to 0 and add 2011-07-23 16:12:22


Hey there,

I hope you guys can help me.

So I have the typical set up that whenever you get 100 coins in my game you get an extra life. The coin count is then reset to 0 to start all over again with the coin collecting.

In my game, however, there are some coins that are worth 1, 3, 5 or 10.

If the user has 99 coins and then collects a +3 coin, the users coin count is reset to 0. This is because I have it set up that whenever the amount of coins collected is equal to or above 100, it shall reset to zero. I want to change it so that when the user collects coins that would put them over 100, it would reset to 0 and add the coins left over.

In other words, the user has 99 coins and collects a +3 coin. The user gains a new life and his coin count is set to 2. (Started with 99 coins, obtained a +3 coin so 99+1 coin = 100 which means 1 more life and rest the counter, then add the 2 leftover from the +3 coin).

Hope you guys can help me.

Thanks

Response to Resetting coin count to 0 and add 2011-07-26 11:34:24


Have it subtract 100 instead of just setting it to 0. Have not downloaded this yet, but I did work with the old Games Factory in the past and you were able to subtract in that.