How do i display only the x-value of an object´s position?

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

How do i display only the x-value of an object´s position?

Postby Drachenbauer » Thu Jul 25, 2019 11:24 pm

Hello

I´m creating a long-jump-contest for my Angry Birds marbles.
The jump-point is at the 0-position of the scene.
So i want to display the x.value of their position on the sand-place, if they collide with it.
But how do i extract only the x value from the position thing in the script-menu (i only managed to display both values in square brackets)?
Drachenbauer
 
Posts: 18
Joined: Thu Jun 20, 2019 5:29 pm

Re: How do i display only the x-value of an object´s position?

Postby FRA32 » Fri Aug 09, 2019 7:23 pm

pos(0) is X, pos(1) is Y. This applies to all square brackets, always starting from 0 for the first. Keep in mind that pos(0) = 9 would NOT work, as square bracket content is read only, unless you replace everything at once using pos = [9,pos(1)];
FRA32
 
Posts: 227
Joined: Wed Dec 03, 2014 9:51 pm

Re: How do i display only the x-value of an object´s position?

Postby Drachenbauer » Sun Aug 11, 2019 6:06 pm

Thanks, now i can create the right output for my project.
Drachenbauer
 
Posts: 18
Joined: Thu Jun 20, 2019 5:29 pm


Return to Help / Bug reports

Who is online

Users browsing this forum: No registered users and 4 guests

cron