What does < ? : mean?

Get help using Construct 2

Post » Thu Feb 26, 2015 10:18 am

(cos(cangle) * (dist < radius ? dist : radius)) + sanaPad.X

What does < ? : mean, in this formula?
B
10
S
5
Posts: 220
Reputation: 1,464

Post » Thu Feb 26, 2015 10:23 am

< means the usual, the ? mark is the thing that's special here - it's basically an "if" operator - so if dist is less than radius it uses dist, else it uses the radius.
B
19
S
6
G
6
Posts: 1,101
Reputation: 5,646

Post » Thu Feb 26, 2015 11:11 am

Game design is all about decomposing the core of your game so it becomes simple instructions.
B
52
S
22
G
18
Posts: 2,122
Reputation: 17,093

Post » Thu Feb 26, 2015 11:34 am

Oh yea, thank you. Now it becomes clear.
B
10
S
5
Posts: 220
Reputation: 1,464


Return to How do I....?

Who is online

Users browsing this forum: plinkie and 12 guests