[SOLVED] How do I make a calculation with global variables?

Get help using Construct 2

Post » Mon Jul 21, 2014 6:37 pm

Greetings,

As i said in the topic, can i make a calculation like 2x3 = 6 with global variables?

Thanks.
Last edited by Xenovia on Mon Jul 21, 2014 7:25 pm, edited 1 time in total.
B
18
S
2
G
1
Posts: 67
Reputation: 1,339

Post » Mon Jul 21, 2014 7:03 pm

Yes. Just use the variables and the operators... O.o
Bruno

I like to eat, but I'm no cook. Why liking to play games would make you a game designer?
B
20
S
6
G
2
Posts: 620
Reputation: 3,492

Post » Mon Jul 21, 2014 7:09 pm

Yes, you'll find the option in the system conditions.

Let's start with creating 3 global variables names i, j and k.

Add event -> System -> Compare two values -> i * j = k

or you could also do

Add event -> System -> Compare Variable -> i = k/j

Both these should return true as long as i = 2, j = 3 and k = 6.

Or if you want to just take 2 globals and do pure math, try using an Action.

Add action -> System -> Set Value -> k = i * j
B
11
S
3
G
1
Posts: 98
Reputation: 1,062

Post » Mon Jul 21, 2014 7:24 pm

Thanks it worked!
B
18
S
2
G
1
Posts: 67
Reputation: 1,339


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 7 guests