+ 2

How do I increase a number by more than 1 using ++ or similar?

Hi Everyone, I'm trying (keyword there) to make a mini game and I would like the ability to upgrade collection amounts. For example, I'm currently using " water++ " to increase the water quantity by 1, but I'm adding features which I want to increase the amount collected, with a bucket I would want it to add 2 & more for other resources. Is there a way I can do this? I've tried looking through the tutorial, but can't seem to find what I need. Any help would be greatly appreciated. Thanks. - LozzaB

5th Feb 2017, 2:10 AM
lozzanerd
lozzanerd - avatar
4 odpowiedzi
+ 10
water = water + 2
5th Feb 2017, 2:21 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar
+ 8
water+=2
5th Feb 2017, 2:27 AM
Krisna A. Haryadi
Krisna A. Haryadi - avatar
+ 5
var color = 4; color += 3; // color = color + 3 will increase by 3 color -= 5; // color = color - 5 will decrease by 5 color *= 2; // color = color * 2 will multiply by 2 color /= 7; // color = color / 7 will divide by 7 color %= 3; // color = color % 3 with modulo
5th Feb 2017, 3:57 PM
Vishnu Damwala
Vishnu Damwala - avatar
+ 1
Thank you 😊
5th Feb 2017, 2:24 AM
lozzanerd
lozzanerd - avatar