Position or Vector2 type

Get help using Construct 2

Post » Sat Jul 20, 2013 8:41 pm

Is there a way to store a position as a single data type?

Since this is a 2D engine, I figured there'd be a native way to store a position in a single variable, in order to store a position, or to be able to store an array of positions.

For example, in most 2D games, I'd expect there to be a struct or class called Position or Vector2 that simply has two numbers X and Y.

For an editor like this, having a natural way to store positions global, local, or instance would be tremendously intuitive.

Is there a best way to do this?

Thanks
B
11
S
2
Posts: 55
Reputation: 807

Post » Sat Jul 20, 2013 8:46 pm

Yeah , I was thinking of suggesting this too , but for now , you'll need to stick to an X,Y array or 2 variables

@Ashley , what do you think ?
B
42
S
17
G
17
Posts: 2,247
Reputation: 17,471

Post » Sat Jul 20, 2013 11:01 pm

@CannedEssence What about using string
Array Set value at (0,0) to Sprite.X&"|"&Sprite.Y
And
Set Sprite position at
X= int(tokenat(Array.At(0,0), 0, "|"))
Y= int(tokenat(Array.At(0,0), 1, "|"))Katala2013-07-21 14:49:40
B
34
S
9
G
3
Posts: 517
Reputation: 5,246


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 42 guests