Hi,
For Random(10) it means 0-9.
1)Does RandomInRange(1,4) means 1,2,3 only?
2)Why must we take RandomInRange(80, 640-80)? Why cant we straight take (80, 560)?
Thanks again!
Hi,
For Random(10) it means 0-9.
1)Does RandomInRange(1,4) means 1,2,3 only?
2)Why must we take RandomInRange(80, 640-80)? Why cant we straight take (80, 560)?
Thanks again!
The random in range has a minimum and a maximum value.
The first number in the brackets is the minimum value and is followed by comma then the maximum value.
You can write it with the subtraction in it, gdevelop would subtract it.
After reading Gem Dev and Gyuszko comments it sounds like you can write it either way, with 560, or by using 640-80.
Now going off that info, my guess is that the person who programmed it had a screen resolution set to 640 width. So they wrote (80, 640-80) to demonstrate that the boundary range is exactly 80 from the left and 80 from the right sides of the screen. So that means if your resolution was different, then you could instead use (80, your game resolution - 80). Say if a game’s resolution is 800 width, then you could use (80, 800 - 80) . Just guessing but I might be wrong.
Thanks a lot for your explanation! Helps me understand more
Thanks a lot for your explanation!
Thanks for explaining the details