How Get Positions

Get help using Construct 2

Post » Sat Mar 09, 2013 9:55 pm

Friend I am new in Construct.

I have question .

if you have 8 separate objects

ex. Num1, num2.... num8

I want to get each X,Y positions

I take array and in event For n = 1:8 Set XY X | n , Y | 1 , Value ???? how write num[n].X or num(2).Y


thank you
B
13
S
3
G
3
Posts: 28
Reputation: 2,798

Post » Sat Mar 09, 2013 10:09 pm

I believe.. you want to try...

For Each Object - Set Array Value at (Object.num, 1) to Object.X
               - Set Array Value at (Object.num, 2) to Object.Y

Your X values will be in the first row of the array, and your Y values will be in the second. Generally I think you don't want to try to store two values in one cell of an array, it gets unnecessarily messy.

You can assign each object an num instance variable to keep track of them, or use their IIDs if you don't mind their number changing.

Mistakes were made.
B
37
S
17
G
67
Posts: 1,041
Reputation: 38,211

Post » Sat Mar 09, 2013 10:41 pm

Use For Each ?
when I want to Set Array Value I have Problem .



maybe I can't understand you .

Asatur2013-03-09 23:10:16
B
13
S
3
G
3
Posts: 28
Reputation: 2,798


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests