Long counter

For questions about using Classic.

Post » Fri Mar 22, 2013 9:20 pm

Hi, i need get number how long way car did travel and save into privatevariable....but hell, i absolutelyd o not know how to, please help.
B
24
S
4
G
2
Posts: 318
Reputation: 2,446

Post » Sat Mar 23, 2013 4:52 am

I don't know if this is an easy way.
Have three private variables first: Ox, Oy, TD
Ox = car's old X position.
Oy = car's old Y position.
TD = Total distance.
now calculate the distance between old position and now position.

Start
-Set Ox = Car.X
-Set Oy = Car.Y

Always
-Add private variable "TD" = distance(Ox, Oy, Car.X, Car.Y)
-Set Ox = Car.X
-Set Oy = Car.Y
B
7
S
2
G
1
Posts: 21
Reputation: 692

Post » Sun Mar 24, 2013 11:34 am

Thx :)
B
24
S
4
G
2
Posts: 318
Reputation: 2,446


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 5 guests