How do I create a pattern for number intervals?

Get help using Construct 2

Post » Fri Aug 25, 2017 7:35 am

0 - 24 = 5
25 - 49 = 10
50 - 74 = 15
75 - 99 = 20 etc

so if A is in the range of 0-24 B has to be shown as 5. This pattern extends indefinitely.
B
5
S
1
Posts: 17
Reputation: 361

Post » Fri Aug 25, 2017 8:37 am

Maybe something like this..

pattern4numbers.capx
B
66
S
24
G
7
Posts: 1,515
Reputation: 11,041

Post » Fri Aug 25, 2017 2:37 pm

How about you divide the number with 5 and then check the range?
Example:

12 / 5 = 2.4 (rounded to 4) ; now you check if the result (4) is higher or less than 5

This however can be tricky and maybe a little ineffective as you have more ranges and need to check them all..

Maybe first you should check if it is lower than 5, if it is not check if it is lower than 10 and if it is set the number to 10, and so on...
My first project:
Image
B
20
S
8
G
1
Posts: 172
Reputation: 2,463


Return to How do I....?

Who is online

Users browsing this forum: Euduardo, mikehive, R0J0hound, tinhofiel and 33 guests