Sense which place you are in a racing game

Get help using Construct 2

Post » Tue May 23, 2017 5:36 am

Hi guys I would love to know how to get the computer to tell the player what position they are in my racing game I have so many AI cars its hard to work out :D
Image
B
36
S
18
G
12
Posts: 332
Reputation: 10,296

Post » Tue May 23, 2017 11:16 am

Measure the total distance travel of each car, and store it in local variable or in an array. The instance with the highest variable will be first, the instance with second highest will be second etc. It it will be hard to implement because you will need something like Bubble sort to find out what instance has the largest value.
Like my work? Fallow me on social media, and see my games on the arcade.
B
7
S
5
G
9
Posts: 298
Reputation: 5,367

Post » Tue May 23, 2017 3:39 pm

@imhotep22 hi I don't really understand do you have a .capx for this?
Image
B
36
S
18
G
12
Posts: 332
Reputation: 10,296

Post » Fri May 26, 2017 3:10 pm

Can't you just output the x, y coordinates of the player? You can then do something with that data to make it more user friendly - such as if x, y = something then player is somewhere specific.
B
11
S
3
Posts: 62
Reputation: 813

Post » Fri May 26, 2017 3:26 pm

You need to have a system of waypoints, and count how many of them each car passed. When two or more cars are at the same waypoint, you then rank them according to their distance to the next waypoint.
B
78
S
32
G
27
Posts: 1,021
Reputation: 20,952

Post » Fri May 26, 2017 3:54 pm

do you have a capx four this?
Image
B
36
S
18
G
12
Posts: 332
Reputation: 10,296


Return to How do I....?

Who is online

Users browsing this forum: tasukilee and 21 guests