+ 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
4 odpowiedzi
+ 10
water = water + 2
+ 8
water+=2
+ 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
+ 1
Thank you 😊