How do I make a position assigned to a single variable ?

Get help using Construct 2

Post » Sat Feb 14, 2015 7:47 pm

So, here's two numbers encoded as one. It gets trickier if you want more variable-sized numbers... :P

And it's definitely more trouble than it's worth.
You do not have the required permissions to view the files attached to this post.
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Sat Feb 14, 2015 8:29 pm

Thanks lord shiva :D
B
28
S
8
G
4
Posts: 767
Reputation: 5,960

Post » Sat Feb 14, 2015 8:29 pm

Unnatural20 wrote:So, here's two numbers encoded as one. It gets trickier if you want more variable-sized numbers... :P

And it's definitely more trouble than it's worth.


Very cool, thanks!
B
28
S
8
G
4
Posts: 767
Reputation: 5,960

Post » Sun Feb 15, 2015 1:56 am

Unnatural20 wrote:There's a way you can do it, actually. With weird integer encoding. >.> Let me see if I can't whip up an example.


I don't think there's any doubt it can be done, but it will never be recognised natively by C2. Not sure if its worth it for a bit of syntactic sugar, but to each his own. :)

edit: whoops missed the last few posts. My statement still stands though
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sun Feb 15, 2015 6:17 am

The other way to sorta do that is to have an object with instance variables. That's a little closer- have a sprite called Vector4, and instance variables called One, Two, Three, Four, etc... Again- not worth the trouble. Still fun to consider (briefly)
B
11
S
4
Posts: 152
Reputation: 1,236

Post » Sun Feb 15, 2015 5:12 pm

Thanks guys! I thought it was a long shot after learning JS does not even have a proper intager :)

Maybe this feature will be added to Construct3 :D
B
28
S
8
G
4
Posts: 767
Reputation: 5,960

Previous

Return to How do I....?

Who is online

Users browsing this forum: gameglaux, KaptanZorba, Xeeko and 9 guests