POSITION X

If you have problems installing or running Algodoo, have found a bug or need in-game help - this is it!

POSITION X

Postby E4e17 » Tue Oct 15, 2013 2:51 pm

as applying only position on the x axis? , Example: any vector a1 = [1.0,1.2,1.3], only change the index of this vector as 0? , The position vector does not work like I did: pos (0) = (-0.046975), not simply because it works? , How to get stuck in a position of X axis and Y axis is free?
E4e17
 
Posts: 5
Joined: Fri Sep 20, 2013 2:55 pm

Re: POSITION X

Postby E4e17 » Tue Oct 15, 2013 2:58 pm

how to change only the value of the X (index 0) axis in the vector of position?
E4e17
 
Posts: 5
Joined: Fri Sep 20, 2013 2:55 pm

Re: POSITION X

Postby electronicboy » Tue Oct 15, 2013 7:36 pm

You can't set variables in arrays shamefully, however, it's pretty easy to work around this in fixed lengh arrays.

e.this.pos = "[" + scene.my.x + "," + e.this.pos(1) + "]"

When that is evaluated, is should produce a string: such as [8, 9], which will be parsed as an array.
I can't test the code right now, but I can't see why that code wouldn't work. I've built arrays using string concatenation before in algodoo, and it always works fine.
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: POSITION X

Postby E4e17 » Wed Oct 16, 2013 3:45 pm

soo thank you , its work perfect here , :clap:
E4e17
 
Posts: 5
Joined: Fri Sep 20, 2013 2:55 pm


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 5 guests